Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Top 5 Based on Two measures

Hi All,

I am facing issues in finding top 5 suppliers. In table I am calculating % which is first measure, But for some of the suppliers if top % is same then dimension limits picks up random suppliers. For eg. I have selected Top 5 from dimension limit, but if there are 10 Supplier  with same % , out of 10, it picks up randomly 5 values in Top 5.  Now requirement is, first criteria should be % and second criteria should be number of deliveries, So Out of 10 supplier with same %, Top5 should be highest % with highest number of deliveries.

let's say below data

  

Supplier%Deliveries
AA100%66
AB100%99
AC100%78
AD100%97
AF100%77
BC100%69
KC100%98
JK100%96
PT100%67
KT100%51

Note - % and Delivery is calculated

For above data Top 5 should be

  

OutPut Top 5
Supplier%
AB100%
KC100%
AD100%
JK100%
AC100%
14 Replies
Not applicable
Author

One more help, what could be the expression for bottom 5?

Not applicable
Author

like this ?

If(Rank( - Expression% + ExpressionDeliveries/1E10) < 6, Expression%)

sunny_talwar

May be this

f(Rank(-(Expression% + ExpressionDeliveries/1E10)) < 6, Expression%)

Not applicable
Author

This is not working, but what i suggested is working, not sure why

sunny_talwar

Whenever in doubt, create a straight table to see what those expression evaluate to

Rank( - Expression% + ExpressionDeliveries/1E10)

vs

Rank(-(Expression% + ExpressionDeliveries/1E10))

and see what the difference is