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: 
Anonymous
Not applicable

Rank Function

I am using the following function to rank different metrics by state:

aggr(rank(sum({<[RISK STATE]=>}[NET WRITTEN PREMIUM]),4),[RISK STATE]).

My question is how to inverse the order.  I have several ratio metrics where the lowest number would actually be the best versus the normal sales and premiums where the highest number is best.

Thank you for the help,

Justin

1 Solution

Accepted Solutions
robert_mika
Master III
Master III

Try this:

Add - before Sum

aggr(rank(-sum({<[RISK STATE]=>}[NET WRITTEN PREMIUM]),4),[RISK STATE]).

View solution in original post

3 Replies
robert_mika
Master III
Master III

Try this:

Add - before Sum

aggr(rank(-sum({<[RISK STATE]=>}[NET WRITTEN PREMIUM]),4),[RISK STATE]).

Anonymous
Not applicable
Author

Great thank you for the help.

robert_mika
Master III
Master III

You are welcome