Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Karthick30
Creator
Creator

How to Rank based on 2 columns sum

Hi,

Please see my sample data set.  I need the Rank column based on Days Present + Leave

Example. ID 9823 present days is 12 and Leave is 8. So sum is 20. Rank is 1. Like wise for all users.

Finally I need to show Bottom 2 Ranks in my table. Any way to achieve this 

ID Days Present Leave Rank
9971 15 0 4
5243 17 0 2
8234 9 4 5
9823 12 8 1
5783 14 2 3
Labels (1)
3 Replies
salonicdk28
Creator II
Creator II

Hi,

You can sum both the columns in the script like-

(DaysPresent+Leave) as TotalDays and then use this in table's expression-

= Aggr(Rank(Sum(TotalDays)), ID)

I am getting the below result, hopefully this is what you are looking for-

salonicdk28_1-1678956807934.png

Thanks,

Saloni

 

 

MayilVahanan

Hi

Try like below

Dim: ID

Exp: If(Rank(-Sum([Days Present]+Leave)) <=2, Sum([Days Present]+Leave))

-- it will display bottom 2 info

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Karthick30
Creator
Creator
Author

I have some Identical values. So when i put Rank < 10 , I am getting only 9 values.. Because 2 values showing rank 6

Any way to fix this Please