Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to get sequence ranking

Hi,

I have below data and want to achieve ranking, but it gives me different way.

PROD     Sales   Rank

A               12     1

B               10     2

C               8       3-4

D               8       3-4

I am expecting Ranks should be 1,2,3,4, how to achieve this.

Thanks,

4 Replies
Not applicable
Author

Hello,

I believe you're using this expression: rank(sum(Sales)).

Try this one instead to get the result you want (sequential ranking): num(rank(sum(Sales), 4))

I also suggest you check under QlikView help the below topic for examples and detailed explanation:

Examples of Chart Ranking Functions

maxgro
MVP
MVP

for Rank column use expression     rank(....., 4)

and format expression in Number tab as Integer

bill_markham
Champion III
Champion III

jp above is correct above.  The joker here may well have been that rank() returns a dual value, compare these two expressions where the num() & text() show the two different dual representations :

     num(rank(sum(Value), 4))

     text(rank(sum(Value), 4))

Not applicable
Author

Hi,

Use this expression  for Rank

=Aggr(Num(Rank(Sum(Sales),4,1)),PROD)

It's working

ranking.png

Regards,

Vivek