Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
jpapador
Partner - Specialist
Partner - Specialist

Sorting within a Rank function

I am trying to obtain the top 25% of members in a given org.  My issue is that around the cut-offs there are ties.  With the Rank(Field, 4) I am able to get the right number of members but the wrong members that make up those numbers.  In a table box I can sort by the Rank first and then by the members ID number.  The issue is I am trying to use this expression in a text object so I am not able to use the sort tab.

Is there a way to Sort by Rank and then ID number within a text object.  I have already tried an Order By IDNumber ASC in the script and it didn't seem to make any difference.

1 Reply
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Use the ID number to create a fraction that can be added to the value you now rank on.

Maybe something like rank(Field+ IDNumber/100000,4)


talk is cheap, supply exceeds demand