Jump to content
We've recently updated our Privacy Statement, available here ×

Rank () Command - Standard Rank vs Dense Rank - Can I avoid Dense Rank?


jason.sheehan

Recommended Posts

Hi all,

I am working in Jasper Server v7.5
I am using the Rank () function 

converted-file.png.f0cae0670e56114df2ea2237eafaab52.png

The Rank () function works for me.
However when I have records in my report with the same value, and which are tied on the rank, they being assigned the same Rank Value, but the Jaspersoft Rank () function is NOT skipping the next sequential ranking position.

Example from my Jaspersoft Report:

converted-file.png.9a6ad5a799c0a5fd3d6eafea3cc1450c.png

Where the 2 records with MARK = 943 are tied on Rank = 6,  the next 3 records tied on MARK = 941, are assigned Rank = 7.
Instead I am looking for the Rank () command /function to skip from Rank 6 to Rank 8.

I can do this in Oracle SQL no problem.
This is my corresponding Ranking Report written in Oracle SQL in SQL Developer.
When I use the Oracle Rank () command, it skips the next sequential ranking when there is a Tie on the ranking position.

Example:

converted-file.png.f68000b3ad5beaaed8808bad428c9b00.png

Based on the below Definitions of Rank () vs Dense_Rank () from Oracle SQL, it appears that the Jaspersoft Rank () command is a DENSE_RANK rather than a Standard RANK:

"RANK() gives you the ranking within your ordered partition. Ties are assigned the same rank, with the next ranking(s) skipped. So, if you have 3 items at rank 2, the next rank listed would be ranked 5."

"DENSE_RANK() again gives you the ranking within your ordered partition, but the ranks are consecutive. No ranks are skipped if there are ranks with multiple items."

Question - Is there any method / command in Jaspersoft Server where Rank () will result in Ties being assigned the same rank, with the next ranking(s) skipped?

Thank you

Jason Sheehan
Cork - Ireland

 

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...