
Hi All,
I have a data set, Out of that data set I want to calculate the rank of the of selected customer from the parameter and based on the selection who is topper in State, region & country. I have data for Country , State, Region, Customer Name and their Volume. I did the ranking on based on the volume in descending order than ranked them.
Input Data
Country
Region
State
Customer Name
Volume
Rank (Calculated in Tableau)
India
West
Mumbai
JC-MU-01
580
1
India
North
Delhi
JC-DL-02
400
2
India
North
Haryana
JC-HR-04
358
3
India
North
Delhi
JC-DL-03
350
4
India
North
Haryana
JC-HR-03
275
5
India
North
Delhi
JC-DL-05
230
6
India
North
Delhi
JC-DL-01
200
7
India
North
Delhi
JC-DL-04
175
8
India
North
Haryana
JC-HR-02
150
9
India
North
Haryana
JC-HR-01
100
10
India
South
Kerala
JC-KR-01
100
11
India
North
Haryana
JC-HR-05
47
12
From Above data, I choosed JC-HR-03,
Required Output
Selected Customer is (JC-HR-03)
Volume
Rank
MY Customer
275
5
State Customer
358
3
Region Customer
400
2
National Customer
580
1
Hi Sandip,
If I have understood your question correctly then you are trying to know the rank of the customer at different level.
At My Customer level its right, please refer to the below screenshot for the same.
but at state level your desired output is wrong. Your selected customer ranks 2nd in the State with the volume of 275. Your output says rank should be 3 and volume should be 358. Please explain that part.
Similarly at the region level, selected customer stands at Rank 4 and volume remains same which is 275 where you have mentioned it as Rank = 2 and volume = 400. Please explain that as well.
At the India Level, you will get the same ranking as you got for customer since all customers belong to India. Please refer to the below screenshot. As per your output Rank is 1 and Volume is 580 for the selected customer. This Rank belong to JC-MU-01. If you want details of customer with higher volume then you can simply get it we don't need to involve the country here.
Where as actual JC-HR-03, National ranking is 5 and volume is 275 (no change at any level).
Let me know what are your thoughts on this and how you have derived the desired output at the State, Region and National Level.
I am also attaching the workbook in next post. Let me know if this helps.
Thanks and Regards,
Ashish Chaudhari