Tableau Filters 33
Tableau Filters 33
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!
Extract Filters
Data Source Filters
Context Filters
Dimension Filters
Measure Filters
Extract 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.
Right-click on your data source name and select the Extract data option.
Select the field of your choice and choose the field values to apply filter. We
made an extract having sales data of only region West and segment Corporate.
As soon as we click on Extract, it will update the graph for the West region and
the Corporate segment. In this way, we can create multiple set of extracts and
apply them as filters in Tableau sheet.
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.
Context Filters
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.
To add a filter as a context in your Tableau sheet, right-click on the field value
in the filter pane and click on the Add to context option. You can remove the
context from the same drop-down box.
The field name on the filter pane will turn grey when a context is applied.
Look in the image below, Tableau will apply the context on the graph and
show sales information of electronic items for only Corporate segment.
Dimension Filters
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.
Measure Filters
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.
Next, it will ask you to select a range for the values of the selected field. Move
the slider to set your range.
We can see in the screenshot below, the graph of sales only shows the total
quantity of the items sold between 50 and 250.
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.
2. Then, it asks us to select the years from the list of years available. We select
the years 2018 and 2019. To select your choices, check the square boxes from
the list and click OK.
4. We can explore a lot of filter related options from this filter card. Click on
the downward arrow given next to the field name in the filter card to get more
options.
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.
6. Also, the Show Filter option will bring the filter pane on the right-hand side
of our sheet. We can easily select and deselect values from here to
apply/remove filters.
Filter Pane
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.
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.
The next option here is the Custom value list from where we can type the field
name and add it to the filter list.
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.
Also, it has an Exclude option that excludes the fields selected by us and shows
the remaining or unselected field data on the sheet.
2. Wildcard Tab
Using the Wildcard tab, we can specify the string literals based on which we
can filter our data. It has options like Contains, Starts with, Ends
with and Exactly matches.
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.
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.
4. Top Tab
The top tab is used to see only the top or bottom few values in a visualization.
We can set the criterion in the By field option of Top tab.
For instance, we want to see the top 10 entries for the average sales. Upon
entering the conditions in the Top tab, we will get the top 10 brands with the
maximum average sales.