Parameters, A better way to filter Data

Filters are only used to divide data while Parameters add into the interactivity of the visualization. When a parameter is added to the viz, it adds into the flexibility as they are based on some calculation. Here is an important thing to remember, a calculation with logic is always needed for a parameter. After incorporating a calculation, our parameter acts as a filter.

Let’s go ahead and demonstrate the difference between the two. The data that I will be using is Data superstore which is available on tableau saved data sources.

  • Using Filters

We want to filter our data on sum of sales. We want to see the subcategory which had sales over 200,000. First, we drag our subcategory from our data pane to rows shelf. Then we right click and drag our sales to columns shelf, which leads to a pop-up with different options. We use the sum option, so the sum of sales shows up on our columns shelf. Then we go ahead and drag sum of sales on our filters card, with a pop-up with multiple options, as we can see below

We then select at least option from the four and put a value of 200,000 since we need to investigate which sub-categories have sales above 200,000

Now when we press OK, we can see all the sub-categories with sales above 200,000 like as followed

With filters we come across a limitation and that is that with filters we can only chose between one of the two options whether we want to see sales of more than 200,000 or less than 200,000. After selecting on of the options, filter only lets us change the threshold number that is 200,000 in our case. What if we want to see the sub-categories with sales less than 200,000 without having to go back and forth and change our filter from scratch.

  • Using Parameters

Here comes, Parameters into play which let us choose if we want to see sales above of below our threshold by just one simple click. First, we create a parameter named “Sales Parameter”.

After creating a parameter, we need to make a corresponding calculation, which is shown below

Then we select True, if we want to to filter data with sales more than 200,000

With Parameters we can choose to see the sub-categories with less than 200,000 by clicking on True and False. True gives us filtered data of sub-categories with more than 200,000 sales and False gives us filtered data of sub-categories with less than 200,000 sales.

 

 

 

 

 

 

 

 

Maliha Athar
Author: Maliha Athar