Last Modified Date: 05 Feb 2018
AnswerThe instructions below can be reviewed in the attached packaged workbook.
- Create a set based on top N for the desired measure by opening the context menu for the dimension
- Drag the dimension onto the Rows shelf, and drag the set onto Color on the Marks card.
- Open the context menu on the dimension pill in the view, and sort it by the desired measure
- Create table calculations for [Last Color] and [Last Row]. [Last Color] should be defined as LAST() = 0, and [Last Row] should be defined as FIRST() = LAST()
- Create a [Replacement Measure] calculation, for the measure used to rank by top N (and sort):
IF [Last Color] AND [Last Row] THEN WINDOW_SUM(SUM([Original Measure])) ELSE SUM([Original Measure]) END
- Place [Replacement Measure] on Text on the Marks card, and edit the table calculations from the pill's context menu, so that [Last Color] is calculated along the set, and [Last Row] is calculated along Table (Down). The main table calculation should be computed along the set.
- Create a [Top N Filter] calculation, as follows (using top 5 as an example):
RANK(SUM([Original Measure)) <= 5 AND ATTR([Set Name])
- Drag this calculation to the Filters shelf, and filter to include values where the calculation is True. Because we are filtering on a table calculation, this modification to the view occurs only after the Grand Totals are calculated (so that the Grand Totals are preserved).
Thank you for providing your feedback on the effectiveness of the article.
Open new Case
Training and Tutorials