Tableau lets you filter individual views or entire data sources based on dimensions, measures,
or sets. In databases, filtering is a useful way to see only the data you want to see. When the
data is visualized in a readable, actionable format, Tableau filters are required to highlight any
underlying insights that can be derived from it.
Tableau filters are based on a condition that can be used to limit the number of records in the
database. Tableau filters support both simple cases based on field values and advanced
calculations or context-based filters. The Tableau filter you choose, or a combination of Tableau
filters, is largely determined by what you want to limit your data set to.
8.1Types of Tableau Filters
Tableau filters can be used to organize and visualize data based on predefined criteria in several
ways. Tableau has a total of six different types of filters:
Extract Filter
Data Source Filter
Context Filter
Dimension Filter
Measure Filter
User Filter
Extract Filter
As understood by its name, the extract filters are used to extract data from the various sources,
by saving a screengrab of the way it gets added on your file. Such methods can help in lowering
the tableau queries to the data source. As soon as you are done extracting data into your
dashboard, you can create the extract and execute Hide All Unused Files to clear the columns
unused in the datasheet of your panel.
The Tableau filter that extracts a small subset of data from the original data source is the extract
filter. If the user extracts data from the data source, this Tableau filter is used.
After connecting the text file to Tableau, you’ll see two options in the top right corner of the
data source tab: Live and Extract. A direct connection to a data source is referred to as a live
connection. And the extract connection takes the data from the data source and saves it to the
Tableau repository as a local copy.
The following is a step-by-step procedure for creating a Tableau extract filter:
Step 1: Connect the text file to Tableau.
Step 2: Click on the Extract button as shown below:
a
This creates a local copy in the Tableau repository.
Step 3: Select Edit from the drop-down menu near the Extract button in the
top right corner. The Extract Data window is opened. Select the Add option
in the Window.
Step 4: Select a Tableau filter condition from the Add Filter window. Any of
the fields can be added as an Extract filter. Choose the category from the list
and click OK.
[Type text]
After clicking on OK, a filtered window will appear which shows data that was extracted using the
Extract Tableau filter.
You can also customize the list or use all values in the list.
[Type text]
There are different options other than the general category from which you
can extract data using Extract filter:
The Wildcard option is used to filter fields using a Wildcard match. Users can
type the character and the field will be filtered according to the match. The
different types of matches are:
Contains Select the members if the member name contains typed characters.
Starts with Select the members if the member name starts with typed characters.
Ends with Select the members if the member name ends with typed characters.
Exactly Select the members if the member name exactly matches with typed characters.
matches
You can customize your data using these matches and you will get the filtered data.
The Tableau filter on condition option is used to filter the data set by
giving several conditions.
o You can filter data using multiple Byfield conditions following the steps below:
Step 1: In the Filter, the window selects the Condition tab.
Step 2: Click on the Byfield button.
Step 3: Select the name of the field to be filtered.
Step 4: Choose the aggregation type like Sum, average, and median from
the drop-down list.
Step 5: Select the operator from the drop-down list.
Step 6: Filter the selected field by entering the value.
Step 7: Click Ok.
[Type text]
You can also filter by condition using a formula. Follow the steps below to filter using
conditions:
o Step 1: Click on the By formula.
o Step 2: Enter the formula in the box.
o Step 3: Click on the Ok button.
You can also filter data using Top or Bottom filters, which are used to select the top or bottom n
number of records. You can select filters Byfield or by the formula in this option too by
following the steps from the previous option or referring to the steps from here.
[Type text]
8.2Data Source Filter
The Tableau Filter that applies the filter directly to the data source, allowing
for quick uploads of data is the Data Source Filter. It can limit the number
of records in the data set. Both live and extracted connections are supported
by the Data Source Filter.
The process to select data filter is done by following the steps given:
Step 1: On the data source tab, click the Add button in the top right corner.
Step 2: The Edit Data Source Filters window appears. In the window,
[Type text]
select the Add option.
[Type text]
Step 3: Follow the remaining steps from the topic Extract Filters -> Step 3 after clicking the
Add button.
8.3Context Filter
A context filter is a discrete filter on its own, creating datasets based on the original datasheet and the
presets chosen for compiling the data. Since all the types of filters in tableau get applied to all
rows in the datasheet, irrespective of any other filters, the context filter would ensure that it is first
to get processed
Despite being constrained to view all data rows, it can be implemented to choose sheets as and
when required to optimize its performance by minimizing the data efficiently. ntext Filter is a
standalone Tableau filter that can create a new dataset from the original data set and compute the
worksheet selections. Context Filters are used to boost the performance of data source views, filters,
and queries. You could run a context filter before any other Tableau Filters, and then apply the
remaining filters on top of the data returned after context filtering.
To make a Context Filter, go to the context menu of an existing categorical filter and select Add to
Context. Once the view is created, the context is calculated. The context is then used to calculate all
other filters. Consider using a data source like Sample-superstore to find the top 10 subcategories of
products in the Furniture category. The following are the steps to take to create a context filter:
Step 1: Drag the Sales field to the Columns shelf and the Sub-Category field to the Rows shelf.
Step 2: From the Show Me tab, select the horizontal bar chart.
Step 3: Drag the Sub-Category to the Filters shelf once more. The chart below is what
you’ll get.
[Type text]
Step 4: In the filter shelf, right-click on the Sub-Category field and select Edit
Filter, then select the Top tab in the pop-up window.
Step 5: Select the set fields set from the drop-down menu. Select Top 10 by Sales
Sum from the next drop-down menu, as shown below:
Step 6: Select the Category field and drag it to the filter shelf. To edit the
Category field, right-click on it and select Furniture from the drop-down menu.
As a result, three product subcategories are displayed below.
Step 7: Right-click on the Category: Furniture filter and select Add to Context
to add the context filter.
[Type text]
Step 8: All of the preceding steps combine to produce a final result that displays a subcategory of
products from the Furniture category.
Context filter is created because:
Improve Performance: Queries will take a long time to run if you want to use a lot of filters
or if your data source is large. In this case, you can improve performance by using one or more
context filters.
Create a Dependent Numerical or Top N Filter: You can arrange a numerical or top N filter
after setting a context filter to include only the data of interest.
8.4Dimension Filter
In Tableau, dimensions are independent fields, typically any field that contains categorical or
qualitative data. Dimension Filters are those Tableau Filters that are applied to dimensional
data. It’s a non-aggregated filter that allows you to add a dimension, group, sets, and bins. The
top or bottom conditions, wildcard match, and formula can all be used to apply a Dimension
Filter. This Tableau filter can be used to include or exclude members from a dimension from
[Type text]
the list. The following is the procedure for adding a dimension as a filter:
Step 1: Choose a dimension from the drop-down menu.
[Type text]
Step 2: The Tableau Filter Window appears. Choose a member from the drop-down menu.
Step 3: Click on the Ok button.
The procedure above filters the data set to only show records for the category Furniture.
8.5Measure Filter
The Tableau Filter that can be used to filter data based on the values in a
measure is called the Measure Filter. Fields containing quantitative data are
commonly referred to as measures. The data can be modified using the
aggregated measure values in a Measure Filter. A Measure Filter can be applied
by following the procedure:
Step 1: You can gain access to Worksheet
o Choose a measure from the Measures tab. Drag the value into the Tableau
Filter field.
o The Measures tab allows you to select a metric. In the Tableau Filter field,
drag the value.
o Select Next.
[Type text]
It brings up a window where you must choose a value range. The following are the other types
of options available in the window.
Range of values The minimum and maximum range of measure values can be
given and filtered.
At least A minimum value of a measure is given to filter the data.
At most A maximum value of a measure is given to filter the data.
Special An option to select null or non-null values and filter the data.
Step 1: Choose a range of values. The upper and lower limits for the range of values can be
changed.
Step 2: Click on the Ok button.
8.6User Filter
The Tableau filter that protects the row-level data in a dataset is the User Filter. When the
workbook is published on a server, it can be used. For different users, different filtering
conditions
[Type text]
can be used. It’s the process of limiting what data a user can see depending on
who’s looking at the dashboard.
To apply the User Filter follow the steps:
Step 1: In the Menu bar, select Server from the drop-down menu. Select the
Create User Filter option by moving the cursor over it. To create a user filter,
select the field.
Step 2: The Tableau Server Sign-in window appears. In the window, choose
the Tableau Online option.
Step 3 A Tableau Online Sign-in Window appears. Fill in your email
address and password. Select the Sign In option.
Step 4: It brings up a window labeled ‘User Filter.’ Add a User Filter by
following the steps below.
o Give your user filter a name.
o Choose a user from the list of users.
o Check in the members who are required to appear for the selected member.
Choose Ok.
[Type text]
It establishes a Tableau user filter. As shown below, you can find the user filter in the sets pane.
The user sees only the filtered data when the workbook is published on the server. To secure data,
multiple users can have their User Filters.
Groups in Tableau: Create Groups, Hierarchy & Sort Data
Sort data
Data present in the visualization and worksheet can be sort based on the requirement. It can sort the data based
on data source order, ascending, descending or depend on any measured value.
The procedure for sorting is given as follows.
Step 1) Go to a Worksheet and drag a dimension and measure as given in the image.
[Type text]
It creates a bar chart by default. Category Present in the visual is sorted based on data source order by default.
We can change the sort order by following the below procedure.
Step 2)
1. Right click on Category.
2. Select ‘Sort’ option.
[Type text]
It opens the Sort window. The options present inside the sort window is explained as follows.
[Type text]
Sort Order:
Ascending: It sorts the order of selected dimension in ascending order.
Descending: It sorts the order of selected dimension in descending order.
Sort by:
The field can be sorted by different types of methods. It is explained as follows.
Data Source order It sorts the field based on data source order.
Alphabetic It sorts the field based on the alphabetic order.
Field It sorts the field based on other dimension or measure values.
Manual The user can manually sort the data using this option.
In this example, the category is sorted based on another field namely ‘Sales.’
Step 1: In this window,
1. Click on ‘Field’ radio button.
2. Select the field on which the category is to be filtered.
3. Select the aggregation type.
4. Click on OK.
[Type text]
The above example filters the category field based on the sum of sales in ascending order.
It sorts the data as shown in the figure.
[Type text]
Create Groups
Group is used to combine members present in a field. For example, aggregated values of ‘Furniture’ and
‘Office Supplies’ can be obtained by using group. Once the grouping data in Tableau is done, aggregated value
of ‘Furniture’ and ‘Office Supplies’ can be shown in the visuals. The procedure to Group Data in Tableau is
given as follows.
Step 1)
1. Right-click on the dimension ‘Category’.
2. Click on ‘Create’ option.
3. Select ‘Group’ option.
Step 2) It opens the ‘Create group’ window.
1. Type the name of the group data in Tableau.
2. Select the members to be grouped.
3. Click on ‘Group ‘button.
[Type text]
Step 3) In Edit Group Window,
1. It creates groups in Tableau of ‘Furniture’ and ‘Office supplies’.
2. Click on Ok to create the group.
[Type text]
It created a group in Tableau with the name of Category (Group) and added in the dimension list. This can be
used for visualizing the group by in Tableau method for members present in a field.
The following image explains the functionality of Tableau create group. The sum of sales is visualized for both
furniture and office supplies for grouping in Tableau.
[Type text]
Create Hierarchy
Hierarchies can be building in Tableau to visualize the data in granular level. Tableau hierarchies can be
created by following the given steps.
Step 1) Go to a worksheet.
1. Select a dimension to create a hierarchy. Right-click on the dimension.
2. Select ‘Hierarchy’ option.
3. Click on ‘Create hierarchy’ option.
[Type text]
Step 2) It opens the ‘Create Hierarchy’ Window.
1. Enter a name for hierarchy.
2. Click on OK.
It creates a Hierarchy as shown in the image.
[Type text]
You can add another field to the box and create the hierarchy. In this example, the city is added into a country
hierarchy.
[Type text]
Tableau Sets & Parameters
Sets
Tableau Sets are custom fields used to hold the subset of data based on a given condition.
In real-time, you can create a set by selecting members from the list or a visualisation.
You can also do the same by writing custom Conditions or Selecting Top/Bottom few
records in a Measure.
You can make sets more dynamic and interactive by using them in Set
Actions. Set actions let your audience interact directly with a viz or
dashboard to control aspects of their analysis. When someone selects marks
in the view, set actions can change the values in a set.
Create a dynamic set
There are two types of sets: dynamic sets and fixed sets. The members of a
dynamic set change when the underlying data changes. Dynamic sets can
only be based on a single dimension.
To create a dynamic set:
1. In the Data pane, right-click a dimension and select Create > Set.
2. In the Create Set dialog box, configure your set. You can configure your
set using the following tabs:
o General: Use the General tab to select one or more values that will be
considered when computing the set.
You can alternatively select the Use all option to always consider all members
even when new members are added or removed.
[Type text]
o Condition: Use the Condition tab to define rules that determine which members to include in the
set.
For example, you might specify a condition that is based on total sales that only includes
products with sales over $100,000.
[Type text]
o Top: Use the Top tab to define limits on what members to include in the set.
For example, you might specify a limit that is based on total sales that only
includes the top 5 products based on their sales.
[Type text]
3. When finished, click OK.
The new set is added to the bottom of the Data pane, under the Sets section. A set icon indicates
the field is a set.
[Type text]
Build Sets
Sets create a set of members out of the field present in a data set. It acts as a separated field or dimension. The
procedure to build sets is given as follows.
Step 1) Go to a Worksheet.
1. Right-click on a dimension.
2. Select ‘Create’ option.
3. Click on ‘Set’ option.
Step 2) It opens ‘Create Set’ Window.
1. Name the set to be created.
2. Select the members needs to be added in the set.
3. Click on OK.
[Type text]
This creates a set of the given name.
Fixed Sets
The members of a fixed set do not change. A fixed set can be based on a single dimension or multiple dimensions.
To create a fixed set;
1. In the visualisation, select one or more marks (or headers) in the view.
2. Right-click the marks and select Create Set.
[Type text]
3. In the Create Set dialogue box, type a name for the set.
4. Optionally complete any of the following:
o By default, the set includes the members listed in the dialogue box. You can select the option
to Exclude these members instead. When you exclude, the set will include all of the members you
didn’t select.
o Remove any dimensions that you don’t want to be considered by clicking the red x icon that appears
when you hover over a column heading.
o Remove any specific rows that you don’t want to include in the set by clicking the red x icon that
appears when you hover over the row.
o If the marks you selected represent multiple dimensions, each member of the set will be a
combination of those dimensions. You can specify the character that separates the dimension values.
To do so, for Separate members by, enter a character of your choice.
o Select Add to Filters shelf to automatically move the set to the Filters shelf once it is created.
5. When finished, click OK.
[Type text]
Create Level of Detail Expressions in Tableau
Level of Detail expressions (also known as LOD expressions) allow you to compute values at the data source level
and the visualization level. However, LOD expressions give you even more control on the level of granularity you
want to compute. They can be performed at a more granular level (INCLUDE), a less granular level (EXCLUDE),
or an entirely independent level (FIXED).
How to create LOD expressions
Follow along with the steps below to learn how to create and use an LOD expression in Tableau.
Step 1: Set up the Visualization
1. Open Tableau Desktop and connect to the Sample-Superstore saved data source.
2. Navigate to a new worksheet.
3. From the Data pane, under Dimensions, drag Region to the Columns Shelf.
4. From the Data pane, under Measures, drag Sales to the Rows Shelf.
A bar chart showing the sum of sales for each region appears.
Step 2: Create the LOD expression
Instead of the sum of all sales per region, perhaps you want to also see the average sales per customer for each
region. You can use an LOD expression to do this.
1. Select Analysis > Create Calculated Field.
2. In the Calculation editor that opens, do the following:
[Type text]
o Name the calculation, Sales Per Customer.
o Enter the following LOD expression:
{ INCLUDE [Customer Name] : SUM([Sales]) }
3. When finished, click OK.
The newly created LOD expression is added to the Data pane, under Measures. To learn more about the
types of LOD expressions you can use, see the Types of LOD expressions section.
Step 3: Use the LOD expression in the visualization
1. From the Data pane, under Measures, drag Sales Per Customer to the Rows shelf and place it to the left of
SUM(Sales).
2. On the Rows shelf, right-click Sales Per Customer and select Measure (Sum) > Average.
You can now see both the sum of all sales and the average sales per customer for each region. For example,
you can see that in the Central region, the sales totaled approximately 500,000 USD with an average sale for
each customer being approximately 800 USD.
Tableau - Dashboard
A dashboard is a consolidated display of many worksheets and related information in a single place. It is used to
compare and monitor a variety of data simultaneously. The different data views are displayed all at once.
Dashboards are shown as tabs at the bottom of the workbook and they usually get updated with the most recent
data from the data source. While creating a dashboard, you can add views from any worksheet in the workbook
along with many supporting objects such as text areas, web pages, and images.
Each view you add to the dashboard is connected to its corresponding worksheet. So when you modify the
worksheet, the dashboard is updated and when you modify the view in the dashboard, the worksheet is updated.
Creating a Dashboard
Using the Sample-superstore, plan to create a dashboard showing the sales and profits for different segments and
Sub-Category of products across all the states. To achieve this objective, following are the steps.
Step 1 − Create a blank worksheet by using the add worksheet icon located at the bottom of the workbook. Drag
the dimension Segment to the columns shelf and the dimension Sub-Category to the Rows Shelf. Drag and drop
[Type text]
the measure Sales to the Color shelf and the measure Profit to the Size shelf. This worksheet is referred as the
Master worksheet. Right-click and rename this worksheet as Sales_Profits. The following chart appears.
Step 2 − Create another sheet to hold the details of the Sales across the States. For this, drag the dimension State to
the Rows shelf and the measure Sales to the Columns shelf as shown in the following screenshot. Next, apply a
filter to the State field to arrange the Sales in a descending order. Right-click and rename this worksheet
as Sales_state.
[Type text]
Step 3 − Next, create a blank dashboard by clicking the Create New Dashboard link at the bottom of the
workbook. Right-click and rename the dashboard as Profit_Dashboard.
Step 4 − Drag the two worksheets to the dashboard. Near the top border line of Sales Profit worksheet, you can see
three small icons. Click the middle one, which shows the prompt Use as Filter on hovering the mouse over it.
[Type text]
Step 5 − Now in the dashboard, click the box representing Sub-Category named Machines and segment named
Consumer.
You can notice that only the states where the sales happened for this amount of profit are filtered out in the right
pane named Sales_state. This illustrates how the sheets are linked in a dashboard.
[Type text]
Summary
Users can sort the fields present in the data set.
Tableau groups can be built to group the members present in a dimension.
Users can build hierarchy to show the granularity level present in the dataset.
[Type text]
Sets can be created to select or exclude one or more members from a field. A set can be added as a separate
dimension in Tableau.
Creating a Parameters
A parameter is a workbook variable such as a number, date, or string that can
replace a constant value in a calculation, filter, or reference line.
Example you may create a calculated field that returns True if Sales is greater than
$500,000 and otherwise returns False. You can replace the constant value of
“500000” in the formula with a parameter. Then, using the parameter control,
you can dynamically change the threshold in your calculation.
You can even create a dynamic parameter that’s set to automatically refresh
its current value (to the result of a single-value, view-independent
calculation), list of values (based on a data source column), or range of
values. This will happen each time the workbook is opened and Tableau
connects to the data source referenced by the parameter, or whenever you
select Refresh from the data source’s context menu..
You can make your parameters more dynamic and interactive by using them in
Parameter Actions. Parameter actions let your audience change a parameter value
through direct interaction with a viz, such as clicking or selecting a mark.
Create a parameter
Follow the instructions below to create a new parameter from the Data pane.
1. In the Data pane, click the drop-down arrow in the upper right corner and
select Create Parameter.
2. In the Create Parameter dialog box, give the field a Name.
[Type text]
3. Specify the data type for the values it will accept:
4. Specify a current value. This is the default value for the parameter. In this case, let’s leave the
field as is because we’ll be using the latest data, which we’ll configure in the next step.
5. Specify a value when the workbook opens. In this case, let’s create a dynamic parameter by
setting the parameter’s default value to the result of a single-value, view-independent
calculation.
Notes
If there is more than one value, the workbook would not be able to choose a default
value. The calculation must also be view-independent so that the value won’t
change as the viz changes. To do this, you can use a FIXED level of detail (LOD)
expression that is not dependent on the structure of the viz. All parts of the calculation must be
inside the FIXED LOD expression. If you use a FIXED LOD expression as the default value
and are using context filters, the dynamic parameter will not reflect any context filters. For
more information on LOD expressions, see Create Level of Detail Expressions in Tableau.
For this dynamic parameter, let's use Latest Month. This means that if the connected data source
is updated and the workbook is opened, the parameter will automatically update when the
workbook is opened.
6. Specify the display format to use in the parameter control (Tableau Desktop only).
[Type text]
7. Specify how the parameter will accept values. You can select from the following options:
o All - The parameter control is a simple text field.
o List - The parameter control provides a list of possible values for you to select
from.
o Range - The parameter control lets you select values within a specified range.
The availability of these options is determined by the data type. For example, a string
parameter can only accept all values or a list. It does not support a range.
If you select List, you must specify the list of values. Click in the left column to
type your list of values, or you can add members of a field by selecting Add
values from.
If you select Range, you must specify a minimum, maximum, and step size. For
example, you can define a date range between January 1, 2019 and December
31, 2019, with the step size set to 1 month to create a parameter control that lets
you select each month in 2019.
[Type text]
In this case, to refresh the parameter’s list of values (or domain) whenever the workbook opens,
select List, and then select When workbook opens. Notice that the list of values on the left is
grayed out because the workbook is dynamically pulling values from the data source.
8. When finished, click OK.
The parameter is now listed in the Parameters section at the bottom of the Data pane.
The parameter is also available everywhere else you can use a parameter—for example, on the Top
tab in the Filter dialog box, or in the Reference Line dialog box. Parameters are global across the
workbook and can be used in any worksheet.
[Type text]
Summary
Tableau is a popular Business Intelligence tool used by
thousands of companies around the world. It helps
businesses generate valuable insights by connecting and
analyzing the raw data from different sources. It offers
various tools and techniques that a business can use to
establish relationships between different data sources.
Parameters in Tableau are the container of values used to
calculate and dynamically enter the values that are
otherwise not present in the original dataset. You can
add conditions and select the range of the values for
which you want to create a parameter. After that, you
can incorporate these values into reports and dashboards
and see their effect on different visualizations.
Parameters are a method that transfers the control on
datasets from the author of the report to the user.
Parameters or container values in Tableau are mainly
used to dynamically enter the values in the dataset that
would otherwise not be present in it. With tableau
parameters, you can set the range for any dataset and
only focus on specific data variables/dimensions for
performing data analysis.
Keywords
Parameters: Parameters are useful when you want to add
interactivity and flexibility to a report, or to experiment
with what-if scenarios. Suppose you are unsure which
fields to include in your view or which layout would
work best for your viewers.
Data Source: Data Source is a name given to the
connection set up to a database from a server. The name is
commonly used when creating a query to the database.
The data source name need not be the same as the
filename for the database.
Sets: Sets are custom fields that define a subset of data
based on some conditions. A set can be based on a
computed condition, for example, a set may contain
customers with sales over a certain threshold. Computed
sets update as your data changes. Alternatively, a set can
be based on specific data point in your view.
[Type text]