Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
infosense_devel
Creator II
Creator II

Rank () is not working as expected.

Hello all,

i have one pivot table chart in which i am showing data based on TOP 20 Negetive Difference.

now table now showing 2nd rank, it is showing 1,3,4,5,6,7 and so on.....

Can any one suggest?

Thanks in advance.

11 Replies
sunny_talwar

What is the calculated dimension used to calculate Rank?

infosense_devel
Creator II
Creator II
Author

thanks for reply...

we have to rank our customer_group based on "Difference" column (third from the right in screenshot), so we are using same expression which we are using in "Difference" column and we are just aggr() it by "Customer Group" dimension.

infosense_devel
Creator II
Creator II
Author

=aggr(rank(

    CurrentYear_Invoice

    -

    PY_Invoice

    ))

*-1),Customer_Group)

sunny_talwar

great, but what is the expression

sunny_talwar

Did you try creating a new chart with

Dimension

Customer_Group

Expression

Rank(CurrentYear_Invoice - PY_Invoice))*-1)

and then see that are you getting RANK 2 for any Customer_Group or not?

Anonymous
Not applicable

=aggr(rank (only{1}(CurrentYear_Invoice-PY_Invoice))*-1) ),Customer_Group)

its_anandrjs

Hey did you use more dimensions on this chart where you calculate rank.

hic
Former Employee
Former Employee

Rank() is tricky...

It can skip number "2" if there is more than one that ranks highest.

Further, you seem to have multiple dimensions. Then you need to be on top of whether the Rank() refers to the last dimension only or whether it is for the total. See picture below.

HIC

Rank.png

jonathandienst
Partner - Champion III
Partner - Champion III

Depending on the parameters of the Rank expression, it looks like you have a tie for first place or for second place. The optional 3rd parametert determines how ties are handled (rank up or down).

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein