Here will discuss how to find top N subcategories from each category by Sales by using INDEX().
Please watch the below video to get step by step guide to get top N sub-categories from each category by using the INDEX function in tableau.
The video has step by step guide to achieve this: