Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
polisetti
Creator II
Creator II

How to rank products having same value (dense rank in Qlik Sense)

Hi All,

I'm facing an issue in ranking same valued fields. As shown below, for one business category(TIM) the ranks are split as 1-2 as both the fields have same values. In this case, I want to rank the Source of Business Name field with respect to alphabetical order. "A Experienced" should be ranked as 1 and "B Experienced" as 2.

Capture.PNG

Please let me know how can I achieve this.

Thanks,

Jaswanth

Labels (2)
2 Replies
shiveshsingh
Master
Master

I am not sure if you can do this but by using below trick you can get the desired result.

Please modify it as required.

if(rank(Sum(Marks),4,2) = '1','1','2')

polisetti
Creator II
Creator II
Author

HI Shiven,

Thank you for your response. 

We are writing the rank function in KPI objects and don't want to hardcode rank. Rank won't be always fixed to  1 & 2 and we will have more ranks. Whenever metric values are same, the Rank function will give "1-2", "3-4" for that dimension. 

I am looking for a generic expression which will work in all the cases.

Regards,