Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi..
How to display top 5 values by using of rank function
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)
Use Below in your script:
Load * Inline
[
Customer, Sales
A, 100
B, 120
C, 300
D, 400
E, 75
F, 50
G, 125
H, 2000
I, 250
];
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)
Use Below in your script:
Load * Inline
[
Customer, Sales
A, 100
B, 120
C, 300
D, 400
E, 75
F, 50
G, 125
H, 2000
I, 250
];
Another Way
Create a Straight Table
Dimension
Customer
Expression
SUM({<Customer = {"=Rank(SUM(Sales),4)<=5"}>}Sales)
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