Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to Rank Top X Measures

Hi,

I am trying to rank top 2 measures (see attched). Unfortunately, I am not allowed to crosstable the data and convert the measures into dimension, and so I am not sure how to apply "normal" aggr(if(rank(sum(VALUE))...

Any help will be appreciated.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Maybe like attached, using

=aggr(if(rank(pick(match(d,'M1','M2','M3','M4')

,sum(M1)

,sum(M2)

,sum(M3)

,sum(M4)

),3,0)<=2,d),Dim_01,d)

View solution in original post

4 Replies
Tammy_Milsom
Community Manager
Community Manager

can you use this in anyway.

rank

( pick(match(d,'M1','M2','M3','M4')

,
sum(M1)

,
sum(M2)

,
sum(M3)

,
sum(M4)

),3,0)

Not applicable
Author

Hi tmm,

this is helpful, but how do I display top 2 measure? I cannot seem to get the expression below to work.

=aggr(if(rank(pick(match(d,'M1','M2','M3','M4')

,sum(M1)

,sum(M2)

,sum(M3)

,sum(M4)

),3,0)<=2,d),d)

swuehl
MVP
MVP

Maybe like attached, using

=aggr(if(rank(pick(match(d,'M1','M2','M3','M4')

,sum(M1)

,sum(M2)

,sum(M3)

,sum(M4)

),3,0)<=2,d),Dim_01,d)

Not applicable
Author

Great, thank you.