4 Replies Latest reply on Sep 7, 2018 4:26 AM by megha gawali

Top N Sales for Overall and Specific Region

Hi All,

I have a dashboard with "Region" filter and a table. So, my goal is, when I choose "All', the table should ONLY show the top N Profit for whole region, and when I choose a specific region, the top N Profit for that selected region will be dipslayed. I've already achieved my second goal, but don't know how to display the top N for whole region (when I select "All" the table shows ALL region along with top N for each). Anybody know how to solve this problem? I've attached a sample twb file using Sample Superstore data for your reference (cannot attach twbx file since it's said file too large, sorry!) . Thanks very much.

• 1. Re: Top N Sales for Overall and Specific Region

Hi MN,

Check the attached workbook for the same

For ALL:

For Central:

Hope this helps

BR,

NB

• 2. Re: Top N Sales for Overall and Specific Region

Hi Naveen, thanks so much for your reply, but I'd like to ask: so I have to create 2 different workbooks each for overall and each region? and also why Region should be added to context?

Thanks.

• 3. Re: Top N Sales for Overall and Specific Region

No different Sheets its in single sheet

The reason why region is context because Top filter and dimension filter wont go along

Check the order of operations in Tableau

BR,

NB

• 4. Re: Top N Sales for Overall and Specific Region

Hello,

Here is simple solution to your problem

1) Create Parameter as Region  and add All value extra

2)Write this calculation

CASE [Parameters].[Region]

WHEN 'South' THEN [Region]='South'

WHEN 'East' THEN [Region]='East'

WHEN 'Central' THEN [Region]='Central'

WHEN 'West' THEN [Region]='West'

WHEN 'All' THEN ([Region]='South' OR [Region]='East'

OR [Region]='Central' OR [Region]='West'

)

END

drag to filter shelf and select True.

Now the output will be according to regions and 'All' will select data for all region.

Let me know if it works.