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: 
vlad_komarov
Partner - Specialist III
Partner - Specialist III

Non-standard use of Rank() function

I have a request from the client for non-standard ranking display.

My results have some cases when the values are identical and the ranking based on this value is the same.

The normal QV implementation (rank(sum(Score), 0, 0)) produces the following result (positions 15 - 18):

Image2.jpg

Client wants to have the rank displayed the following way (three ##15s and #16 at the next position):

Image2_1.jpg

I was not able to find the option to do that. The closest result was to use the rank((sum(Score)),0, 1), which produced the following:

Image3.jpg

Any suggestions how to implement this request will be greatly appreciated.

Best regards,

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

Well, this seems like a horrible solution, but it seems to work and I haven't thought of a better one.

match(rank(-sum(Score),0,1),$(=concat(distinct

aggr(rank(-sum(Score),0,1),ID),',',
aggr(rank(-sum(Score),0,1),ID))))

View solution in original post

2 Replies
johnw
Champion III
Champion III

Well, this seems like a horrible solution, but it seems to work and I haven't thought of a better one.

match(rank(-sum(Score),0,1),$(=concat(distinct

aggr(rank(-sum(Score),0,1),ID),',',
aggr(rank(-sum(Score),0,1),ID))))

vlad_komarov
Partner - Specialist III
Partner - Specialist III
Author

Thanks John!

It works exactly like needed.

Regards,

Vladimir

P.S. I like your solution on "negative" rank: (rank(-sum(....)). Looks cleaner than 1/sum(...) one I've used.

Thanks again