How do i filter for top 10 ASINs for each segment according to shipment days DESC

Hi, so i have a pivot table where I have segment and ASIN in my rows and sum of shipment days and total shipments in my values. I have a lot of ASINs so it is showing all of them, but I want to add a filter where I can get the top 10 ASIN for each segment ordered by shipment days DESC so I get the most popular ASIN. Currently when I add a filter it doesn’t show me the option to filter it according to segment, it just filters top 10 ASIN. In my screenshot it only shows body and head when i apply the filter, the tail goes away and those aren’t the top 10 according to shipment days.

Hi @preyapod ,
welcome to the community :slight_smile:

One thing that can solve your issue here is trying to use the denseRank function.

You can create a calculated field, let’s call it e.g. ASIN_Rank:

// NOTE: Don't know here the real name of your fields
denseRank(
    [count({Shipment}) DESC],  
    [{Segment}]
)

Then you just add a filter for ASIN_RANK selecting Less than or equal to: 10.

This should work!
Let me know :slight_smile:

Andrea