Tableau Deep Dive: Parameters – Filtering – Top N

Data

Tableau Deep Dive: Parameters – Filtering – Top N

Tableau Deep Dives are a loose collection of mini-series designed to give you an in-depth look into various features of Tableau Software.

In part 1 of this Deep Dive exploration into parameters, we covered how to create a parameter as well as the four essential steps of using one. For part 2, we covered all of the parameter properties. Now, we’re going to talk about how to use parameters in your filters.

The Top N Use Case

Here’s a sample use case:

I want to show my organization the top products by profit

A filter is the solution if and only if I fix the number of products that are shown. For instance, if I only wanted to show the top ten, I’d create a filter like this:

Top N Filter Product Name

What if instead of a fixed number of products, I wanted to let the report user define how many of the top products they wanted to see? A parameter is the solution. 

We’re starting with this view:

Sum of Profit bars listed by item

Let’s complete this example by following our four steps to creating a parameter from part 1. Remember, they do not need to be in order.

Use Your Calculation in Your View: In part 1 , I had this step at #4. For this example, we’ll start with it. Our calculation is a Top N filter:

Filter dialogue box

The filter control would only allow us to search for products within our top N. Our parameter control on the other hand will allow us to change how many results we are going to show as part of our most profitable products.

Use the Parameter in Your Calculation: From the Filter window, we can employ a parameter in our filter. If we had created prior to creating this Top N filter, it would be in the drop-down list as a selection for how many of the top items we want to display in our view. Since we haven’t created it yet, we’ll select Create a New Parameter.

Create new parameter

 

Build Your Parameter: Remember, there are a couple of different ways to arrive at the Create Parameter window. For our example, we’re going to enter in the following options: 

Create Parameter dialogue box

 

Show Parameter Control: By completing the steps in this order, Tableau will automatically show your parameter control in the view since we created the parameter from within the filter option.

Show parameter control

You can manually show your parameter control by right clicking on the desired parameter and selecting “Show Parameter Control”.

Show parameter control manually

 

Congratulations! You’ve created a Top N filter using a parameter to allow the user to change how many of the top products they want to see:

Top N filter using a parameter control

 

The Difference Between Filters & Parameters

Looking at filter and parameter controls might be confusing as they can look identical if not properly labeled. Consider the following example:

Region filter control       Region parameter control

I’ve added the notation of filter and parameter by editing the filter title and parameter name respectively. While they do look the same, there are some important differences that are worth noting in how they function.

  • Filters are specific to a data source. Parameters are not.
  • Filters are generally slower.
  • Parameters can be used within filters.
  • Filters are created on the worksheet level. Parameters can be reused across the entire workbook.
  • Filters are restricted to the data. Parameters can be manually defined.

These are important differences that really expand parameters into hundreds of different use cases.

What’s Next?

All of the differences highlighted above will come into practice when we create a filter for multiple data sources using a parameter. But first, we need to examine how parameters are used in calculated fields. We’ll do that next in part 4.

If you have any questions, thoughts, or other fun use cases with parameters and filters, please leave them in the comments below. I look forward to hearing from you.

Want More Tableau Deep Dives

  1. Tableau Deep Dive: LOD – Introduction to Detail
  2. Tableau Deep Dive: LOD – The Include Calculation
  3. Tableau Deep Dive: LOD – The Exclude Calculation
  4. Tableau Deep Dive: LOD – The Fixed Calculation
  5. Tableau Deep Dive: LOD – LOD Calculations vs. Table Calculations
  6. Tableau Deep Dive: Parameters – Parameter Overview
  7. Tableau Deep Dive: Parameters – Parameter Properties
  8. Tableau Deep Dive: Parameters – Filtering – Top N
  9. Tableau Deep Dive: Parameters – Calculated Fields
  10. Tableau Deep Dive: Parameters – Filtering Across Data Sources
  11. Tableau Deep Dive: Parameters – Bins
  12. Tableau Deep Dive: Parameters – Reference Lines
  13. Tableau Deep Dive: Parameters – Table Calculations
  14. Tableau Deep Dive: Sets – Introduction to Sets
  15. Tableau Deep Dive: Sets – Constant Sets
  16. Tableau Deep Dive: Sets – Computed Sets
  17. Tableau Deep Dive: Sets – IN/OUT
  18. Tableau Deep Dive: Sets – Combined Sets
  19. Tableau Deep Dive: Sets – Calculated Fields
  20. Tableau Deep Dive: Sets – Hierarchies
  21. Tableau Deep Dive: Dates – Introduction to Dates
  22. Tableau Deep Dive: Dates – Preparing Dates
  23. Tableau Deep Dive: Dates – More Date Functions
  24. Tableau Deep Dive: Dates – Exact Dates
  25. Tableau Deep Dive: Dates – Custom Dates
  26. Tableau Deep Dive: Dates – Rolling Dates
  27. Tableau Deep Dive: Dates – Calendar Filters
  28. Tableau Deep Dive: Dates – Week-by-Week Comparison
  29. Tableau Deep Dive: Dashboard Design – Planning
  30. Tableau Deep Dive: Dashboard Design – Layout & Structure
  31. Tableau Deep Dive: Dashboard Design – Proof of Concept
  32. Tableau Deep Dive: Dashboard Design – Adding Interactivity
  33. Tableau Deep Dive: Dashboard Design – Visual Best Practices
  34. Tableau Deep Dive: Dashboard Design – Optimization & Governance
  35. Tableau Deep Dive: Dashboard Design – Publishing
  36. Tableau Deep Dive: Table Calculations – Custom Sorts, Part One
  37. Tableau Deep Dive: Table Calculations – Custom Sorts, Part Two
  38. Tableau Deep Dive: Table Calculations – Custom Sorts, Part Three

More About the Author

Robert Curtis

Analytics Consultant | ANZ Practice Lead
Tableau Design Tips: Using Images in Your Dashboards Images on your dashboard, combined with visual best practices, make a huge difference when it comes to the impact of your work. My ...
Tableau Data Viz: Genocides of Today This visualization has a personal aspect for me. In April 2017, I was approached by the Tableau Foundation to volunteer my Tableau ...

See more from this author →

Subscribe to our newsletter

  • I understand that InterWorks will use the data provided for the purpose of communication and the administration my request. InterWorks will never disclose or sell any personal data except where required to do so by law. Finally, I understand that future communications related topics and events may be sent from InterWorks, but I can opt-out at any time.
  • This field is for validation purposes and should be left unchanged.

InterWorks uses cookies to allow us to better understand how the site is used. By continuing to use this site, you consent to this policy. Review Policy OK

×

Interworks GmbH
Ratinger Straße 9
40213 Düsseldorf
Germany
Geschäftsführer: Mel Stephenson

Kontaktaufnahme: markus@interworks.eu
Telefon: +49 (0)211 5408 5301

Amtsgericht Düsseldorf HRB 79752
UstldNr: DE 313 353 072