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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
d_koti24
Creator II
Creator II

How to sort the Rank()?

Hi All,

How to sort the rank?

ex:

I have some data in straight table like:

GroupNamesum(amount)Rank(sum(amount))
AAA5003
ACC2005
BBB8001
BAA6002
CBB3004
CDD1006

i want to o/p like this:

group  name   amount  rank

B           BB      800      1

...........

C          DD     100        6

REGARDS,

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

Create a Straight Table

Dimension

Group

Name

Expression

SUM(amount)

NUM(Rank(TOTAL SUM(amount),4))

Double click on 2nd expression to do ascending/descending sorting.

View solution in original post

5 Replies
MK_QSL
MVP
MVP

Create a Straight Table

Dimension

Group

Name

Expression

SUM(amount)

NUM(Rank(TOTAL SUM(amount),4))

Double click on 2nd expression to do ascending/descending sorting.

d_koti24
Creator II
Creator II
Author

Thanks for quick reply.

what is the use that 4. NUM(Rank(TOTAL SUM(amount),4))

MK_QSL
MVP
MVP

IF two SUM(amount) is same then it will give lowest rank on first row and next row will be incremented by one..

say if you have sum(amount) 500 for two Group and Name combination, one will be allocated Rank 5 and 2nd by 6

d_koti24
Creator II
Creator II
Author

I am nt getting correct ranks..can you plz check.

find the sample app.

MK_QSL
MVP
MVP

Like this?

Also you can use this... for total Rank

NUM(RANK(TOTAL SUM(Amount),4))