Tableau Filters – Get the best out of your data
In this Tableau Tutorial, we will learn how to apply filters on data in a Tableau workbook. Here, we will learn about applying simple Tableau filters on data visuals as well as about some advanced types like extract filters, interactive filters, etc. So, open your Tableau Desktop and learn with us!
Keeping you updated with latest technology trends, Join DataFlair on Telegram
Types of Filters in Tableau
Now, let us first discuss what are the different types of filters in tableau which it provides to us and which we can use for our dataset. So, here are the 5 types of Tableau Filters:
- Extract Filters
- Data Source Filters
- Context Filters
- Dimension Filters
- Measure Filters
The Extract filters in tableau create an extract of a small subset of data from the original data source. When we establish a connection with a data source in Tableau, it gives us two options; Live or Extract. When we extract data from a data source, Tableau creates a local copy of that subset of data in its repository. Thus, we can apply the value present in the extract as a filter.
Learn to do the extraction of your data using tableau data extract.
Data Source Filters
Using the data source filters in tableau, we can directly apply our filter conditions on the data source. It filters the data at the data source and then uploads only the remaining data in the Tableau worksheet. To apply a data source filter, go to the Data Source tab and click on the Add option present on the upper right corner.
Again click on Add on the dialog box that opens. Select your field and then tick the values that you want to keep, then click on OK. It will show you a small summary of the selected data source filters. Again click on OK to apply the filter.
Now, we have data for sales of only two categories; Mobile phones and Laptops. Everything we will create from here will consist of only the data related to this filter.
We can edit the tableau data source filter from the sheet view.
By using context filters in tableau, we can apply a general context to our overall analysis of Tableau. For instance, in our sales data of electronic sales, we apply the context of the Corporate segment. This means that all of our analysis after this will be relevant to or in the context of the corporate sector.
The dimension filters are the filters that we apply on individual dimensions. Dimensions are not aggregated and so, we can select distinct values from the list of field values. To apply the dimension filter, drag a dimension from the list of dimensions to the filter pane. Complete the filtering steps and apply the filter. The dimension filters are shown in blue in the filter pane.
The measure filters are the filters that we apply using the measure field values. Measure values are always aggregated like sum, average, median, etc. To apply a measure filter, drag a measure field from the measures list to the filter pane. It will ask you to select an aggregation type on the filter value.
Now!! As we move further, let us see and learn about how to apply these different types of tableau filters which we can use.
How to Apply Filters in Tableau?
For better understanding, we have a sample data set of an electronic store in USA. We made a connection from Tableau to the data source in our system. Have a look at a horizontal bar graph in tableau which shows category and subcategory wise sales of electronic items like phones, cameras, etc.
The colored segments that you can see in each bar is the region-wise segmenting based on sales. That is, it shows the total sales for individual region of USA like Central, West, South, and East. Also, this graph contains fields “Sales”, “Category”, “Regions” and “ Sub-category” from the data set.
In this data set, we have sales data for four years, that is, 2016, 2017, 2018 and 2019. What we are going to do now is apply filters on this dataset so that we can see data from only the years 2018 and 2019.
1. For this, we first drag the field or dimension “Order Date” to the Filters pane. As our field is a date field, it will ask us to select in what way do we want the date to appear, that is, year, quarter, month, days, weekdays, etc. We select Years and click Next.
3. As soon as we apply the Tableau filter, it will automatically update the graph and show two separate sections for sales in the year 2018 and 2019. On the left-hand side, in the filter card, the name of the field is showing with the filter we selected, that is, YEAR(Order Date).
5. We can also apply filters on individual fields that we select to make graphs. We just need to open the drop-down menu from the small downward arrow present on the right of every field in the Row and Column sections. The drop-down list has a Filter option using which we can apply the filter on specific field values.
In the previous section, we learned how to apply a filter or in other words how to filter out unwanted data from our dataset in Tableau. Now, let us have a closer look at the filter pane of Tableau. In order to stay efficient, you must know well about all the options and tabs of the filter pane.
The filter pane in Tableau has four tabs:
- General Tab
- Wildcard Tab
- Condition Tab
- Top Tab
All four of these tabs are loaded with very useful options. Let’s have an insight into these four filter pane tabs.
1. General Tab
In the general tab, we get to select the values from a column that we want to keep or remove for our analysis. In other words, the data that we want to filter. As shown in the image below, we select two regions of our choice from the list. Click OK to apply the filter.
Next to this option is the Use all option, we can use this if our list is very long and we don’t want to select all the values manually.
2. Wildcard Tab
Suppose from the enormous list of cities, we only want to see the sales data of the cities starting with New word like New York, Newark, etc. We can type New in the Wildcard tab and it will give us all the matching results.
Please note that wildcard filters are case sensitive.
3. Condition Tab
The condition tab gives us the option to apply a condition on the filter. For instance, if we have a graph showing region-wise sales of electronic items, then we can apply a condition filter to show us only the sales values greater than 50,000.
As soon as we click on OK, it will show us regions, where total sales made, was greater than 50,000. You can also make a formula with the condition of your own and apply it here.
To do this, select the By formula option and enter a formula that is a filter condition. A filter formula option gives you the freedom to enter a condition as per your requirement and relevance to the data.
For instance, if you wish to show sales value greater than 50,000 then we can apply this condition by entering a formula SUM([Sales])>50,000. In the same way, you can formulate any condition based on your needs in this section and apply it on your data set.
4. Top Tab
This concludes our tutorial on Tableau filters. Here, we saw different types of filter options available in Tableau. Then we learned how to apply filters in a standard Tableau worksheet. Lastly, we explored the filter pane and its various tabs in detail.
See you in the next tutorial on Tableau Histogram.
We hope that you learned from our Tableau Filters tutorial. In case of any queries regarding this article, leave your comments in the comment section. We will be happy to solve your queries.