Top 5 Values & Others

Hi,

Top 5 Values & Others.
How do we achieve this and if possible post a dedicated video in “What’s New” tab for this if possible.

As i tried by taking the rank initially and then create a calculated field
like

ifelse(rank<=10, {name},NULL)

but again this is show aggregation mismatch error.
Need urgent help.

Best,
Vaibhav Narwade.

Hello,

Please take a referance from Sanpshot for better understanding of the question.

Best,
Vaibhav.

Hi @Vaibhav.narwade,

You don’t need to calculate the rank for this. Sort your x-axis in descending order and then format your visual to show only 5 data points. All your other data points will be grouped as “Other”.

You should probably also disable sorting so that your readers can’t change the sort order. If they change the sort order to ascending, your visual will show the bottom 5 products instead of top 5.

2 Likes

@David_Wong ,

Impressive…
Appreciate your quick response.
I am trying this from last 2 day but its amazing thank you so much.
how we can achieve this in Pivot / Table as well.
Can you suggest another way for this as well.

Best,
Vaibhav Narwade

@Vaibhav.narwade
That’s the easiest way because it doesn’t involve any calculated field but it doesn’t work with tables or pivot tables because you can’t format the table to only show 5 rows and Quick Sight won’t group the rest as “Other”.

The other way to do this is more complicated but will work with tables.

Sales by Product

sumOver(Sales, [Product], PRE_AGG)

Product Rank

denseRank([{Sales by Product} DESC], [], PRE_AGG)

Product Group

ifelse({Product Rank} < 6, Product, 'Other')

Finally just add Product Group to your x-axis and Sales(sum) to your y-axis, and sort your x-axis by Product Rank in ascending order.

2 Likes

@David_Wong,

Oh… Nice…:heart:
Thank you so much dear.

Best,
Vaibhav Narwade.

1 Like