Jack Wallen shows you how to create a Top N filter in Tableau, so you can easily filter your products (or any data point) by the “top N” positions.
Image: Elnur/Adobe Stock
A Top N filter returns data according to a number you assign it — hence the “N” in the name. For example, you have 1,000 products that your company sells and you want to view only the top 5 products: For that, you’d use a Top N filter.
SEE: Research: Digital transformation initiatives focus on collaboration (TechRepublic Premium)
Tableau supports Top N filters, but they can be a bit tricky to create. I’m going to show you how to do just that via the Tableau Desktop App using the Superstore sample data.
What you’ll need
To make this work, you’ll need a Tableau account, the Superstore sample data added, and the Tableau Desktop App installed.
How to create the Top N filter
Are you ready? This isn’t quite intuitive, so hold on to your seats.
Open the Tableau Desktop app and then connect to the Superstore sample data. Once you’ve done that, expand the entries in the left pane until you see Manufacturer. Drag Manufacturer to the Rows shelf and then drag Sales to the Columns shelf (Figure A).
Adding Manufacturers and Sales to the proper shelves.
In the Data tab in the left pane, click the drop-down and then select Create Parameter (Figure B).
Creating a new parameter for the Top N filter.
Name the new parameter Top N. Under Allowable values, click Range and then select the checkboxes for Minimum and Maximum (Figure C).
Configuring the new parameter.
Click OK. Next, on the Rows shelf, right-click on Manufacturer and select Edit Filter (Figure D).
Our filter is ready to edit.
In the resulting window (Figure E), click the Top tab. Select By Field and then, in the second drop-down, select “Top N.” Make sure Sales and Sum are selected in the other drop-downs and click OK.
Configuring our new filter.
Back in the Data pane (far left pane), under Parameters, right-click on Top N and select Show Parameter (Figure F).
It’s time to show our Top N parameter.
Once you’ve done this, you should see a Top N slider in the upper right corner of the view (Figure G).
You can change the field by moving the slider to the right or left to show more results.
Congratulations, you just created your first Top N filter in Tableau! Your data is now much easier to filter by top products, services and sales.
Subscribe to TechRepublic’s How To Make Tech Work on YouTube for all the latest tech advice for business pros from Jack Wallen.