rank function but within a column

Stimulsoft Reports.JS discussion
Post Reply
palmer83
Posts: 17
Joined: Thu Apr 20, 2023 7:33 pm

rank function but within a column

Post by palmer83 »

Hello,

When I use the following in a calculated column, it does a ranking but based on the entire data in my data source (called WfGapPiv).
Totals.Rank(WfGapPiv, WfGapPiv.Gap, false,Stimulsoft.Report.StiRankOrder.Desc)

But I don't want the ranking to be based on my entire data but rather the rank within a group. How can I modify that so that it ranks within a certain column, in this case called PlanBc.

How can I get it to look like this?
PlanBc Gap MyCalculatedColumn
A 100 1
A 90 2
A 80 3
A 70 4
A 60 5
B 50 1
B 40 2
B 30 3
B 20 4
B 10 5
Lech Kulikowski
Posts: 7287
Joined: Tue Mar 20, 2018 5:34 am

Re: rank function but within a column

Post by Lech Kulikowski »

Hello,

You can add an additional grouped source - DataTransformation, and then use the Rank function for the grouped source.

Thank you.
Post Reply