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: 
varunreddy
Creator III
Creator III

Bottom five values using rank function

Hi Guys,

I have found top 5 values using rank in the expression

Only({<MonthYear>} aggr(sum({<MonthYear,

Name = {"=rank(sum({<MonthYear= {'$(vCurMonthYear)'}>}1-([Total Number of Failing Records]/[Total Number of Records])))<=5"}

>}1-(
[Total Number of Failing Records]/[Total Number of Records])),MonthYear,Name))

Now I am trying to find bottom 5 values using the rank.

Can anyone help me with this?

Thanks in advance!

Regards,

Varun.

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try the rank of the value multiplied by -1:

Only({<MonthYear>} aggr(sum({<MonthYear,

Name = {"=rank(-sum({<MonthYear= {'$(vCurMonthYear)'}>}1-([Total Number of Failing Records]/[Total Number of Records])))<=5"}

>}1-(
[Total Number of Failing Records]/[Total Number of Records])),MonthYear,Name))


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try the rank of the value multiplied by -1:

Only({<MonthYear>} aggr(sum({<MonthYear,

Name = {"=rank(-sum({<MonthYear= {'$(vCurMonthYear)'}>}1-([Total Number of Failing Records]/[Total Number of Records])))<=5"}

>}1-(
[Total Number of Failing Records]/[Total Number of Records])),MonthYear,Name))


talk is cheap, supply exceeds demand
varunreddy
Creator III
Creator III
Author

Gysbert,

Thanks for your quick response.

Cheers!

Varun