Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Sort on a Calculated field Post Reply Post New Topic
Author Message
vsyriac
Newbie
Newbie


Joined: 22 Jun 2010
Location: United States
Online Status: Offline
Posts: 13
Quote vsyriac Replybullet Topic: Sort on a Calculated field
     Posted: 26 Jun 2010 at 9:36am
Is there a way to sort records on a calculate field which is computed from the group total.   That is  group total *100 divided by the another group total.
 
 
Crystal Novice
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 28 Jun 2010 at 3:21am
Not unless the group total is already calculated...like in a stored proc.  CR has to figure out what the group total is, and it does that later in the process (when displaying the report) than grouping.  Grouping is off of data that exists in the table, pretty much directly.  You can group on a field, several fields in combination, but not the average of a group as that does not exist in the data table.
 
If you get your data from a stored proc, have it calculate the values that you need and return them as a column...if you have the total of the group, then you could sort on the calculated value as both parts of the calculation that are needed are available to CR at the time that the data is read.
 
Hopefully, this is clear enough
IP IP Logged
vsyriac
Newbie
Newbie


Joined: 22 Jun 2010
Location: United States
Online Status: Offline
Posts: 13
Quote vsyriac Replybullet Posted: 28 Jun 2010 at 3:40am
Perfect answer. Thank you very much. 
Crystal Novice
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum