Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Sorting Group/Top N Post Reply Post New Topic
Author Message
rftd
Newbie
Newbie


Joined: 09 Jun 2008
Online Status: Offline
Posts: 24
Quote rftd Replybullet Topic: Sorting Group/Top N
     Posted: 16 Jul 2009 at 12:32pm

I have a report where the data is grouped by IP Address (one of the fields in the db). I wanted to display only the Top N groups, however the group sort expert was grayed out. So, I created a summary field to enable the group sort. However, it will only let me sort the data based on that summary field and nothing else.

Is there any way I can sort the data based on another 'non-summary' field?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 16 Jul 2009 at 12:38pm
It is greyed out because you need to add a Summary for the group level to activate it.
This would be how you are defining your top N.
IP IP Logged
rftd
Newbie
Newbie


Joined: 09 Jun 2008
Online Status: Offline
Posts: 24
Quote rftd Replybullet Posted: 16 Jul 2009 at 1:10pm

Let me be a little more clear, I have one summary which counts the total number of failed transactions for each group and another summary which gives me an overall number of transactions for each group.  I also have a formula field called 'failure rate' which is basically equal to CountofFailed/TotalCount.

However, I cant get Crystal reports to allow me to sort by the failure rate.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 16 Jul 2009 at 1:50pm

Gotcha. What I am describing below is a new idea for me and I have not used it myself (yet)...I did test it in a sandbox report and I think the logic is sound but please test this idea more thouroughly for yourself.

Create a formula field as "Fail Percentage" (or whatever you want):
if {table.field}=failed then 100 else 0 
//the red is your condition to know if a row is counted as failed
 
Now Insert a Summary on this formula field as an Average at the group level of IP Address.
This should give you the same number / percentage value as your other formula (CountofFailed/TotalCount) but allows you to use it in the TOP N Group Sort Expert.
Let me know if it works for you as this pesky issue seems to come up a lot Thumbs%20Up
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