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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need Help Using Rank in a Pivot Table

Hi,

I am really struggling to figure out how to use the Rank function in a pivot table.  All previous examples I've seen do not have a horizontal dimension and I've tried adding in a calculated dimension as well as an expression but to no avail.  All I want is an additional column with 1 - 10 in it but this seems to be a real struggle. 

Can anyone help?

1 Solution

Accepted Solutions
swuehl
MVP
MVP

What about using a calculated dimension like

=aggr(rank(sum(Amount))&' - '&  Client_Group,Client_Group)

instead of Client_Group?

edit:

Or an additional calculated dimension

=aggr(rank(sum(Amount)),Client_Group)

together with your existing ones?

View solution in original post

7 Replies
Not applicable
Author

Example of what I'm trying to get attached ...

Not applicable
Author

add an expression column with =rowno()

swuehl
MVP
MVP

What about using a calculated dimension like

=aggr(rank(sum(Amount))&' - '&  Client_Group,Client_Group)

instead of Client_Group?

edit:

Or an additional calculated dimension

=aggr(rank(sum(Amount)),Client_Group)

together with your existing ones?

Not applicable
Author

Hi Pari Pari - I tried rowno() both as a calculated dimension and an expression but couldn't get it to work.

If you've managed it can you attach an example?

Thanks,

Emma

Not applicable
Author

Hi Swuehl,

Many thanks - both answers work really well and my end user has a big smile on her face! 🙂

Cheers,

Emma

swuehl
MVP
MVP

Your welcome.

The CON to this solution is that we are using a calculated dimension, which might not perform very well on large data. But If your end user keeps on smiling ...

Another possibility that came to my mind is to print some static numbers (text objects, straight table) next to your pivot table. Not really nice, but with nice performance 😉

In a straight table, you could probably work out a solution using rowno(), as suggested above.

Have a nice day,

Stefan

Anonymous
Not applicable
Author

Hi Stefan,

Can you please take a look at my post:

https://community.qlik.com/message/1175515/edit?draftID=1040661