Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Ranking in Crystal XI Post Reply Post New Topic
Author Message
rkorb
Newbie
Newbie
Avatar

Joined: 04 Sep 2009
Location: United States
Online Status: Offline
Posts: 31
Quote rkorb Replybullet Topic: Ranking in Crystal XI
     Posted: 15 Mar 2010 at 8:32am
We are trying to create a formula that would rank a record based on the date of the record (1, 2, 3, etc...).  Is this possible without getting into that OLAP stuff?

Thanks!!
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 15 Mar 2010 at 9:35am
if you have a group based on the date, then you could just use a counter like:
shared numbervar iRank := iRank +1;
 
iRank
 
you could reset it everytime the group outside of the date group changes, or not, depending on what your needs are.
 
I would think that this would work.
IP IP Logged
rkorb
Newbie
Newbie
Avatar

Joined: 04 Sep 2009
Location: United States
Online Status: Offline
Posts: 31
Quote rkorb Replybullet Posted: 15 Mar 2010 at 10:02am
Thanks!  This, plus a small formula to reset at each group, gave us the rank.  Unfortunately we wanted to group based on rank (all the 1s, all the 2s, etc.) and you can't seem to do that because of the whileprintingrecords.
We still learned something!
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 16 Mar 2010 at 3:15am
if you got the data via a stored proc, you could create a column that would be rank, and then you could easily group on that.
 
yeah, you can't group on a calculated value...at least not one like this(if it was one that could be derived from existing values in the data you could) since the value is not set at the time that the report is being read.
 
glad I could help in some small way.
IP IP Logged
rkorb
Newbie
Newbie
Avatar

Joined: 04 Sep 2009
Location: United States
Online Status: Offline
Posts: 31
Quote rkorb Replybullet Posted: 17 Mar 2010 at 5:44am
That helps explain it a lot!  Thanks for your help!
BeccaSmile
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