• Bernard

Tableau Tips: Top/Bottom N members (Index(),Size(),Integer)

In the previous two articles ( article 1 & article 2 ) of this series, we learned how to compute the Top/Bottom 10 profitable customers using sets and table calculation rank respectively. In this article, we are going to tackle the same challenge but now using an integer and table calculation Index() and Size() .

Using superstores data set packaged with Tableau app, lets populate the Top/Bottom 10 profitable customers. Once connected to the data set above,..

Create calculated field - Index

  • Right click anywhere under dimension or measure area and select >> Create >> Calculated Field,..

  • Rename your formula Index as show below.

Create calculated field - Size

  • Repeat the same procedure above to create the field Size as shown below.

Lets create a formula that will enable us select the Top/Bottom 10 profitable customers using Calculated field Index, Size and integer 10 as shown below.

Lets build our chart.

  • Drag dimension Customer Name to the Rows shelf.

  • Drag measure Profit to the Columns 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.

  • Drag the field 'Top/Bottom 10 profitable customers' above to the filter and select 'Top 10 profitable customers' and 'Bottom 10 profitable customers' respectively.

  • Drag 'Top/Bottom 10 profitable customers' to the color pill and chose your preferred color. (optional)

See the resulting chart below.

Note that our final result is exactly like in our previous articles. I hope one of the technique will be much helpful in your daily tasks as an analyst.

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

Thank you for reading.