Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Ranking Post Reply Post New Topic
Author Message
Gurbs
Senior Member
Senior Member
Avatar

Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
Quote Gurbs Replybullet Topic: Ranking
     Posted: 13 Mar 2012 at 4:49am
Hi all,

I have created a report that shows the collections per client within a certain period. This period is determined by 2 parameters. Next, I only show the top 30 clients based on their collections. And at the bottom, I showed the total collections of all the clients.

Now my question is, how can I calculate the collections of only the top 30 clients? I want to see the collections from our top 30 clients against the total collections.

I was thinking about ranking the clients each time the report is created. This way I could just say add rank 1 till 30. But how can I do this? Anyone has any ideas?

Thanks in advance.

Kind regards,

Gerben
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 13 Mar 2012 at 5:07am
While this not my favorite way to approach this issue, it does seem to be the best suited.
I would create a delimited string of the top client ids like |1|2|5|7| (I like pipes, but any delimiter will work), and then use this to link to a subreport. (this string would be built in group headers probably, though I can see it in the detail section as well...it's up to you as to what is the easiest)
 
The subreport would use the delimited string to determine the top clients and what their collections are and can display them, either as 1 summary or as several broken by the clients, or however you deem fit.
 
It's what I would try...
 
HTH


Edited by lockwelle - 13 Mar 2012 at 5:08am
IP IP Logged
Gurbs
Senior Member
Senior Member
Avatar

Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
Quote Gurbs Replybullet Posted: 13 Mar 2012 at 5:20am
I fixed it by using a running total. This way he only uses the clients that are shown on the report.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 13 Mar 2012 at 5:22am
i would approach it a little differently.
If you use the group sort expert you can either use a graph or pie chart to show the top 30 individually as compared to the rest as 'others'. or you can use running totals to conditionally sum records before or after the 30 marker.
IP IP Logged
Gurbs
Senior Member
Senior Member
Avatar

Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
Quote Gurbs Replybullet Posted: 13 Mar 2012 at 6:42am
I did the second option. I checked it by manually calculating all 30 records, and the numbers matched. But thank!
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