3 Replies Latest reply on Nov 1, 2017 5:34 AM by Jonathan Wisloch

How to preserve Top N filter when changing filter choice on a dimension?

I am a relatively novice user and so I will cast this query in what are likely layman's terms, however here I go...

My scenario is a simple one and is as follows:

Dimensions:

1. Company - For which there are multiple company code combinations that I would like to filter on.

2. Vendor - For which there are multiple vendors

Measure:

1. Accrual value

I would like to create a table that allows me to view Top 10 Vendors by accrual value. My starting point is therefore to apply a top 10 sort on the vendor dimension by sum on accrual value. I have also introduced the company dimension as a filter.

The issue I encounter is that I want my Top 10 filter to function at a level of granularity beneath the 'company' dimension, such that irrespective of the company(ies) I have selected under my company code filter, Tableau returns the Top 10 vendors by sum of accrual value for that particular filter selection of companies. Instead my top 10 is always based on all companies, irrespective of the company filter I have in place, and therefore will only return vendor(s) & accrual value(s) for a given company code/set of company codes, to the extent that they feature in the top 10 across all company codes.

How do I configure such that a Top 10 is delivered for whatever company code selection I have in place? (excepting those companies whose total set of vendors is < 10 - although these do not exist in practice)

Thanks,

Jon

• 1. Re: How to preserve Top N filter when changing filter choice on a dimension?

Hi,

Have you tried placing company in context?

~Tushar

• 2. Re: How to preserve Top N filter when changing filter choice on a dimension?

Hi, Jonathan

You can create a top 10 set as shown below,

Hope this could help

ZZ

• 3. Re: How to preserve Top N filter when changing filter choice on a dimension?

HI Tushar, many thanks for this - this has worked perfectly.

In summary the solution to deliver top 10 filter

1. Bring in Vendor dimension into Rows

2. Apply the Top N sort by sum of accrual on the vendor field

3. Bring in the company dimension into filter, and then 'Add to context' (via right click on company dimension in the filters section.

4. My desired view was non-graphical, so I have brought in the Sum(accrual) measure into my Marks as Text.

Linking the top 10 sort to the company code filter through the company code context, means I can now filter by company code and deliver the Top N for that company code or combination of company codes as determined by the context filter.

Thanks!

Jon