Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Identify top 5 and low 5 records Post Reply Post New Topic
Author Message
keeper
Newbie
Newbie


Joined: 02 Mar 2009
Online Status: Offline
Posts: 4
Quote keeper Replybullet Topic: Identify top 5 and low 5 records
     Posted: 02 Mar 2009 at 11:37am
I have a report where I have to group data by customer.  Within that group I have to identify top 25 ( no problem there).  Within top 25 I have to identify top 2 and low 2 based on the calculated field.  I can not sort by it (it is not a group field) :  Example:
Customer          Sales         Rate increase
ABC                  $5,678          10%
XYZ                   $4,687          15%
DFG                   $4,677          12%
 
Top 2 are 15% and 12%.  I have to color them in green. How can I do it in the report.


Edited by keeper - 02 Mar 2009 at 5:06pm
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 02 Mar 2009 at 11:59am
you can still sort on it.
Click on sort Expert and add the formula field to the sort fields just under the group sort the choose ascending or descending.
IP IP Logged
keeper
Newbie
Newbie


Joined: 02 Mar 2009
Online Status: Offline
Posts: 4
Quote keeper Replybullet Posted: 02 Mar 2009 at 12:04pm
The field is not even showing up as an available field to sort on
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 02 Mar 2009 at 12:09pm
what formula are you using to get the data?
IP IP Logged
keeper
Newbie
Newbie


Joined: 02 Mar 2009
Online Status: Offline
Posts: 4
Quote keeper Replybullet Posted: 02 Mar 2009 at 12:14pm
Here is my formula:
 if Sum ({@Calc8WeeksUnits}, {ad_mstr.ad_name}) = 0
  then
     0
 else
  (((Sum ({@Calc4WeeksUnits}, {ad_mstr.ad_name})
   - Sum ({@Calc8WeeksUnits}, {ad_mstr.ad_name}))
    /Sum ({@Calc8WeeksUnits}, {ad_mstr.ad_name})) * 100)
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 02 Mar 2009 at 12:31pm
Gotcha.
You cannot sort on the SUM formulas based on the order in which the data is read.
Nothing else is coming to mind for this right now.
Anyone else have ideas?
 
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