Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Saurabh07
Contributor III
Contributor III

Rank basis on Absolute value but display Positive/Negative number in table

Hello Gurus,

I have mentioned dataset:

CountryValue
India-7854
Japan-7662
Korea6589
China6541
Germany-6102
France5028
Italy4036
Australia3521
Netherlands-2258
Denmark1975

I want to pick Top 5 countries on basis of highest value. But my condition is, the ranking should be done considering the absolute value but while displaying the value in table it should display the original (positive/negative) number.

Any help on this requirement would be highly appreciated!

1 Solution

Accepted Solutions
MayilVahanan

HI @Saurabh07 

May be try like below

Dim:

=Aggr(If(Rank((if(Sum(Value)<0, Sum(Value)*-1, Sum(Value))))<=5, Country),Country)

Measure1: Sum(Value)

Measure2: Rank((if(Sum(Value)<0, Sum(Value)*-1, Sum(Value))))

MayilVahanan_0-1606715569067.png

 

 

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

View solution in original post

3 Replies
MayilVahanan

HI @Saurabh07 

May be try like below

Dim:

=Aggr(If(Rank((if(Sum(Value)<0, Sum(Value)*-1, Sum(Value))))<=5, Country),Country)

Measure1: Sum(Value)

Measure2: Rank((if(Sum(Value)<0, Sum(Value)*-1, Sum(Value))))

MayilVahanan_0-1606715569067.png

 

 

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

@MayilVahanan this worked, thank you so much!!!!

Akbar
Contributor II
Contributor II

thank you 🙂