0 votes
1 view
in BI by (17.1k points)

I have a dataset with dog ids, dog names, and neighborhoods. I would like to display the n most popular dog names for each neighborhood. How can I do that?

I figured how to display counts for each name in each neighborhood, by simply dragging 'Neighborhood' and 'Animal Name' in 'Rows', and 'CNT(Animal Name)' in 'Columns'. But I don't know how to select the top 3 or 4 names for each neighborhood.

1 Answer

0 votes
by (46.1k points)
  • Tableau's Sample Superstore dataset can be used to walk through one way you can show the top N number of Products by Category. This example will easily transfer to Dog Names by Neighborhood.

  • Create a Tableau calculation and use as a filter later.

RANK(COUNT([Product Name]))


  • And then put the Category and Product Names dimension on the Rows shelf and the Count of Product Names on the Text marks card.

  • Now, place the Production Popularity table calculation on the filter shelf.

  • When the dialog box appears, just click OK.

  • Edit accordingly how our Table calculation runs to get the Top N Product Names within each Category.

enter image description here

  • Now, Select Specific dimension and then uncheck Category or Neighborhood in your case.

enter image description here

  • Now we need to go edit our filter.

enter image description here

  • For this example,Set the upper limit to 3.

enter image description here

  • Click OK and then you must be able to see the top 3 Product Names by Category.

enter image description here

  • You need to adjust this example to fit your data.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !