Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
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