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: 
Nora104
Partner - Creator
Partner - Creator

How to use rank function to sort values from small to large in pivot table

I want to add a rank column to the front so that it will start from small to large by index B:

1.png

But I use the formula:=aggr(rank(sum(indexB)),Code)

But the result is the below, the values are sorted from largest to smallest:

2.png

How can I write the formula to sort from small to large?

 

1 Solution

Accepted Solutions
MayilVahanan

HI @Nora104 

Try like below

=aggr(rank(-sum(indexB)),Code)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

1 Reply
MayilVahanan

HI @Nora104 

Try like below

=aggr(rank(-sum(indexB)),Code)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.