# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
cancel
Showing results for
Did you mean:
Creator

## how to display top 5 values by using of rank function

Hi..

How to display top 5 values by using of rank function

1 Solution

Accepted Solutions
MVP

Considering that you have customer and sales data and you want top 5 customers by sales

Create a Straight Table

Use Calculated Dimension

=IF(Aggr(Rank(SUM(Sales),4),Customer)<=5,Customer)

Expression

SUM(Sales)

[

Customer, Sales

A, 100

B, 120

C, 300

D, 400

E, 75

F, 50

G, 125

H, 2000

I, 250

];

3 Replies
MVP

Considering that you have customer and sales data and you want top 5 customers by sales

Create a Straight Table

Use Calculated Dimension

=IF(Aggr(Rank(SUM(Sales),4),Customer)<=5,Customer)

Expression

SUM(Sales)

[

Customer, Sales

A, 100

B, 120

C, 300

D, 400

E, 75

F, 50

G, 125

H, 2000

I, 250

];

MVP

Another Way

Create a Straight Table

Dimension

Customer

Expression

SUM({<Customer = {"=Rank(SUM(Sales),4)<=5"}>}Sales)

Creator II

I did as suggested. But my problem now is, it is taking top 5 as 100% rather than whole, and dividing them as per the share.

ex:

I need each one of the exact share(%) in the whole sum i.e, SUM(Sales).

Br, Balanandam