5 Replies Latest reply on Aug 25, 2016 7:07 AM by Aseem Bhartiya

# Top N and Others Sub Cat by Customers Sort Desc

Hi All,

Need help, I am creating a view for Top n and others for sub category by count of customers.

I want to sort the top n sub categories by descending and Others should come last even if we apply top n parameter

others should always be below but rest should be by descending. Attached sample please look into it.

Thank You.

• ###### 1. Re: Top N and Others Sub Cat by Customers Sort Desc

This is the best explanation of how to do the sub-category sort and top N I've found:

• ###### 2. Re: Top N and Others Sub Cat by Customers Sort Desc

Hi,

What you can do is create other calculation as below :

IF [Top N Sub Category Dim]='Others' THEN 'Others' ELSE 'Club' END

Put this calculation on the Rows.Then, uncheck the show header for this field.

This should have the desired result.

Attached is in newer version of Tableau, not sure if you would be able to open it.

Thanks,

Aseem

• ###### 3. Re: Top N and Others Sub Cat by Customers Sort Desc

Thanks Aseem it was really helpful

• ###### 4. Re: Top N and Others Sub Cat by Customers Sort Desc

Hi Asheem,

i am trying to calculate percentage of total but the values are all messed up, can you please help.

• ###### 5. Re: Top N and Others Sub Cat by Customers Sort Desc

It won't work, because you doing count distinct.

When you do as percent of total, it looks for distinct customers across all catgories combined, rather than summing up distinct customers at individual category level.

You will have to create LOD for these purposes.