cancel
Showing results for 
Search instead for 
Did you mean: 

Ranking in cross tab reports

Former Member
0 Kudos

Hi All,

I am working on a cross tab crystal report and need to display ranks by groups. I have attached a screenshot of the report for convenience (i have grayed out the data). All the columns displayed in the image are developed except for the rank column. Rank column is dependent on the % column before it (i.e. cloumn 8). Also, I was able to sort column 8. I have added a sample rank column and need the ranks accordingly by group.

Thanks in advance!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I was able to come to a solution. Wanted to share if it could be of any help to others. Its not the best solution for sure but is effective.

if

NthLargest (1,Field,Group_name) = Field

then 1

else if NthLargest (2,Field,Group_name) = Field

then 2

else if NthLargest (3,Field,Group_name) = Field

then 3

and so on....

Here "Field" is the the criteria which is used to rank. The criteria in my case was a summarized field.

And "Group_name" is the level at which the cross tab is grouped.

Since it was highly unlikely in my case that any group will have more than 20 items so I can rank stuff without making the formula terribly big. But NthLargest has a limitation which will not work for more than 100 items.

Thanks!

Answers (1)

Answers (1)

Former Member
0 Kudos

i was able to add a serial column to the report with the help of below code in the Format Field -> "Display String" section of my report. But the problem now is it is not resetting by each group. Instead it is behaving as a serial number.

Thanks

numbervar e = 0;

e:=e+1;

totext(e,'#');

Former Member
0 Kudos

Hello,

Ranking will be based on the summarized field as whole and cannot be based on a single column.

See this: How do I rank a column in a Crystal Reports Crosstab? - Business Objects: Crystal Reports 4 Other to...

Thanks,

DJ

Former Member
0 Kudos

Thanks for your reply DJ. The columns that I am referring to are in fact the summarized fields in the report.