Tableau Tips: Top/Bottom N members (use of sets)
top of page

Tableau Tips: Top/Bottom N members (use of sets)

Updated: Nov 7, 2022


top and bottom n members of a dimension in Tableau

In daily today operations of businesses, different decisions are required to be made based on different scenarios institutions face, in many instances analysts find themselves overwhelmed due backlog at hand and therefore availability of an easier way to answer such short simple business requests could help them a lot.

In our today's challenge, I will show you how to populate the Top/Bottom 10 profitable customers using Tableau sets.

I will be using Superstores data set pre-packaged with Tableau app, lets jump into the real stuff.

Create set - Top set

Once you've connected to Superstores data set above, follow the steps below to create the top set.

  • Right click on dimension Customer Name >> Create >> Set

  • On the pop up menu fill as show below.

creating top n set in tableau

Create - Bottom set

Repeat the above procedure to create the bottom set, see below.

creating bottom n set in tableau

Next, I am going to combine the two sets to create a single set called 'Top/Bottom 10 profitable customers'

Top achieve this

  • Right click on one of the two sets above and select 'Create Combined Set'.

  • On the dialogue box that pops up fill as show below.

creating a combined set in tableau

Note the above set, returns all members from the two sets combined.

Lets build our chart.

  • Drag dimension Customer Name to the Row shelf.

  • Drag measure Profit to the Column shelf. (Note profit is aggregated by SUM(), you can correct this if your default aggregation is different)

  • Sort the chart in descending order by clicking on the sort icon on the tool bar.

  • Next drag the set 'Top/Bottom 10 profitable customers' into the filter shelf.

  • Drag either 'Top 10' or 'Bottom 10' set to the color shelf to differentiate Top customers from the Bottom one's. (Optional)

See the resulting chart.

example of top and bottom n members of a dimension in Tableau

Note: In the above chart, the set 'Top 10' set was dragged to the color shelf and IN members edited to 'Top 10' while OUT members were edited to 'Bottom 10'.

I hope this article was helpful to you.

To receive more of the Tableau tips and tricks, kindly subscribe to our mailing list below.

If you like the work we do and would like to work with us, drop us an email on our Contacts page and we’ll reach out!

Thank you for reading!

Blog.png
Black & white.jpg

About Me

More About the Author

Bernard K

Analytics Consultant | 3X Tableau Certified

Bernard is a data analytics consultant helping businesses reveal the true power of their data and bring clarity to their reporting dashboards. He loves building things and sharing knowledge on how to build dashboards that drive better outcomes.

Let’s discuss your data challenges! Let’s work together!

bottom of page