Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
alvinford
Contributor III
Contributor III

Rank Function Help

Hi All ,

I have the below table , the requirement is to rank the UserName based on the sales value and display the first three UserNames as in the output shown below. Please help to get this requirement.

   

UserNameShopNameSalesValue
XABC100
YABC90
XABCD100
YABCD90
XABCE90
YABCF100
ZABC80
ZABCG90
VAAA80
ZABCF100
VABC80
UABB70
VABCD80
UABD80
VABCF20

Output

   

RankUserNameShopNameSalesValue
1XABC100
ABCD100
ABCE90
2YABC90
ABCD90
ABCF100
3ZABC80
ABCG90
ABCF100

Thanks & Regards,

Alvin

5 Replies
MK_QSL
MVP
MVP

Like this?

Create a pivot table

Dimension

1)

=Aggr(IF(Rank(SUM(Total<UserName>SalesValue))<=3,Rank(SUM(Total<UserName>SalesValue))),UserName)

Tick Suppress When Value is Null

2) UserName

3) ShopName

Expression

SUM(SalesValue)

Capture.JPG

tresesco
MVP
MVP

May be this?

Capture.PNG

Expression: =Aggr(If(Rank(Sum(SalesValue))<4, Rank(Sum(SalesValue))),UserName)

alvinford
Contributor III
Contributor III
Author

Hi Tresesco,

Thank you for your reply. Its Working fine. Have other requirement on the top it. How can I display Top 2 ShopNames for the Top three ranks as I have more than one ShopNames

The Output expected is as below

 

RankUserNameShopNameSalesValue
1XABC100
ABCD100
2YABCD90
ABCF100
3ZABCG90
ABCF100

Thanks & Regards,

Alvin

tresesco
MVP
MVP

Use the expression like below:

If(Rank(Sum({<UserName={"=Rank(Sum(SalesValue))<4"}>}SalesValue),4)<3, Sum(SalesValue))


Capture.PNG

alvinford
Contributor III
Contributor III
Author

Hi Tresesco,

Thank You Very much .. it worked for me ..