• Bernard

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

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

In our today's hypothetical case, lets assume you're are an analyst in a retail store, and your manager has requested you to populate Names of the Top/Bottom 10 profitable customers.

Using Superstores data set packaged with Tableau app, lets generate the Top & Bottom 10 profitable customers using sets.

Create set. - Top set

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

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

  • On the pop up menu fill as show below.

Bottom set

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

Next, we are 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.

Note the above sets, 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 aggregate is different)

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

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

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

Check the resulting chart.

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

See you in the next article as we cover other techniques of computing the Top/Bottom N members.

i hope this article was helpful to you.

To receive more of these Tableau tips and tricks, subscribe to our emailing list below.

Thank you for reading.