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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
wanyunyang
Creator III
Creator III

Continuous rank

Hi guys,

I have a table like this:

Customer, Item, Sales

A, aaa, 5

A, bbb, 5

A, ccc, 2

...

 

I want to rank the sales by customer and item, and this is the function I use:

aggr(rank(Sales),Customer,Item)

 

The results end up like:

Customer, Item, Sales, Rank

A, aaa, 5,  1

A, bbb, 5, 1

A, ccc, 2, 3

...

 

I wonder if it's possible for the third row to have Rank=2?

2 Replies
Vegar
MVP
MVP

This might solve your problem

=aggr(NODISTINCT rank(sum(Sales)), Sales)

Vegar_0-1611850829012.png

 

Ksrinivasan
Specialist
Specialist

hi,

try this

=aggr(rank(sum(Sales)), Customer, Item)

ksrinivasan