Create a category Others

Svg background
Input & output example
Let's say we have a table with revenue by country, such as:
Input to create others
And we want a pie chart with the top 5 of countries per revenue, plus the others category:
Top 5 plus others
Note that if you only have a table with one row per purchase as input, you need to create a first ETL step to aggregate your data per country.
Step 1: compute the rankings in the input table
The first step is to add a ranking function on the input datasource:
Ranking formula
Step 2: store the rankings in a new storage
The second step is to store these rankings in a new storage. To do that, create a new storage named "sales per country with ranking". And create an ETL step to store the rankings per country in it:
etl step to store ranking
Step 3: create the OTHERS category
On this new storage ("sales per country with ranking"), add a new conditional formula named "Country_with_others":
others formula
In this new column, if the rankings is below or equal to 5, we keep the country name, otherwise we use the string "OTHERS".
Step 4: create the pie chart
Create the pie chart using this formula "Country_with_others" instead of "Country" in the dimension selector; and select Revenue in the measure:
pie charts config
×