1 2 Previous Next 26 Replies Latest reply on Jul 23, 2016 10:13 PM by keerthana kumar

# Top 5 customer sales by region

Hi All,

I am using tableau 9.2

I am stuck where i need to show top 5 customer sales by region without showing the customer list as in below image

Below is the scenario

1. Data - In graph there should not be customer Name .For each Region  single bar which is sum(sales) where customer rank is from 1..5

2. Filter - Segment-The graph should show top 5 customer under any segment according to user choice

3. Rank - user choice.. can vary

.

• ###### 1. Re: Top 5 customer sales by region

HI Keerthana,

Sorry for posting partial output. I am really curious on how this to be done.

I am able to get the output but this requires aggregation of aggregation or any better solution that what I have  done.

There must be definitely a way out of this but I am not able to do it. This is also working with segments.

The only problem is that I am not able to sum up this values. This requires ranking by Customer. To calculating rank we require the Customers in detail or we can achieve the same using LOD calc. When I am trying to take the totals they are giving entire total and not for the top 5 customer.

I think there can be a way out. Even I am seeking for the solution. I will get back to you if I find something.

Mahfooj Khan, Dmitry Chirkov, Ivan Young and khalid norat if possible please provide your valuable inputs on this.

-Ashish

• ###### 2. Re: Top 5 customer sales by region

Thanks for the try Ashish . Awaiting for response!!!

• ###### 3. Re: Top 5 customer sales by region

Hi Keerthana,

Please find the attached workbook as per your requirements.

Here I have computed rank as per customer name using tableau "Default calculation". So Use "Rank_Unique" instead of "Rank" for computing Sum of sales.

Thanks

Akram

• ###### 4. Re: Top 5 customer sales by region

Hi Akram Ebrahim,

Thanks for the time and help. But here I can see five bar graph under each region.

Im looking for single bar under each region ....which the sum off top 5 customer sales.

• ###### 5. Re: Top 5 customer sales by region

Yes.

I can't able to do show sum of top 5 into one value here,

If I tried to compute the rank using "Region" the it summarizes for the entire sum of sales.

Expected result:

Region - West - Top 5 customers sum of sales - 44480

Obtained Result:

Region - West - 725448

I will try to achieve and update. I'm also eager to know how it can be possible

• ###### 6. Re: Top 5 customer sales by region

Hi all.

It's possible to dhow one bar for each region but it was no possible to show Top 5 Sum for region because you need the customer on detail.

See what i got.

• ###### 7. Re: Top 5 customer sales by region

Hi,

Please find the attached screenshot and tableau workbook below. Will this serve your purpose?

I have created calc as below

RANK_UNIQUE(SUM({INCLUDE [Region],[Customer Name]: SUM([Sales])}),'desc')<=5

I am still interested to know if can this be done without putting the customer in the detail shelf but I think for now this can serve your purpose.

-Ashish Chaudhari

4 of 4 people found this helpful
• ###### 8. Re: Top 5 customer sales by region

I have been pulling my hair out trying to do this plus looking for an older post I remember that has a similar problem.

No luck yet. If I figure something out soon will let you know or will eagerly await for an answer as this is definitely a tricky one.

• ###### 9. Re: Top 5 customer sales by region

I was trying to calculate the total but i wasn't figured out using reference line.

Nice.

• ###### 10. Re: Top 5 customer sales by region

Hi Aashish,

No need to use LOD here. Simple RANK_UNIQUE will also work.

Warm Regards,

Prashant Sharma - India | LinkedIn

4 of 4 people found this helpful
• ###### 11. Re: Top 5 customer sales by region

Hi Prashant,

Thanks for Feedback. It does work with simple RANK_UNIQUE().

I guess customer are definitely needed to calculate the Ranks by region. but is there any possibility to do this without adding customer to detail shelf? or any way we can get rid of those lines on the bars (due to customers are in the detail shelf) so that bars will look as a single unit?

P.S - Glad you are back in action on forums.

-Ashish

1 of 1 people found this helpful
• ###### 12. Re: Top 5 customer sales by region

Thank u Ashish

Tanx a lot for your effort. I am using 9.2 so i'm not able to open your workbook .

When I am trying Sorting is not happening properly . It order should be Central ,South, East and West.

• ###### 13. Re: Top 5 customer sales by region

Sorry from the side, but I will show my approach.

This is done with Not only filtering Top5, but also limit only displaying 5th data.

Here is the steps.

Then, You will get below table.

And hide index and Customer Name.

9.1 attached.

Shin

3 of 3 people found this helpful
• ###### 14. Re: Top 5 customer sales by region

Hi Shin,

I am unable to open the workbook.

I got above error when I tried opening the same. is there any issue at my end?

Regards,

-Ashish

1 2 Previous Next