Loading

Showing All Values when Top N Filter Results In Less Than N Values

Дата публикации: Apr 13, 2024
Описание
When you apply a Top N filter to a view that uses a second filter, the updated view does not produce the expected Top N result.

For example, in Superstore Sample data, you have a filter on Sub-Category showing Top 5 by Sales, and then filter by Region. The same 5 subcategories will display regardless of which region is selected.

Cause

Top N filters are calculated before other dimensional filters. For more information, see Tableau's Order of Operations.
Решение

Option 1: Add the Second Filter to Context

On the Filters shelf, right-click the second filter, and then select  Add to Context. In the Superstore example above, you would add Region to context. For more information, see Creating Context Filters in Tableau Help.

Option 2: Use INDEX() and a Table Calculation

Follow the instructions in the Finding the Top N Within a Category article to use INDEX() as a top N filter.
Дополнительные ресурсы
To view Option 1 in action, see the video below.
Note: the video has no sound


Номер статьи базы знаний

001473578

 
Загрузка
Salesforce Help | Article