Pages

Thursday, October 16, 2014

Controlling Filter Selection

Creating filters with Tableau is so easy! Right-click, select 'show quick filter' and you have a selection list visible. You can also customize it to show as drop-down, list or slider. By default your filter will include all values from the database. You can also restrict filter options based on additional filters. Below is an example of a 'Country' filter that got generated from my data.
We can see that some data does not have 'Country' populated, therefore the filter has a 'null' value. I don't want my users looking at the 'null' country. I could add a filter and exclude null, but that would be a filter on the field 'Country', therefore I will not be able to have a second filter that is controlled by the user. There are two options to get around this. 1. Duplicate the field 'Country' and use a exclude null filter on that. 2. Create a set and use set as a filter. I personally, find the second option more elegant, so my example is based on that option. Here are the steps: Right-click on the field 'Country', select 'Create Set'. This looks very much like a filter, so go ahead and select all, pick a few values or use a condition. Then drag the set onto the filter shelf. Right-click on the set on the filter shelf and select 'Show Quick Filter' Notice, only selected values are available in the filter. Here is an example that restricts the drop-down to the top 20 countries by population.

No comments:

Post a Comment