Filter Data in Tableau

Filter Data in Tableau is the process of removing some values or a range of values from a set of result data. In Tableau, filters are used to organize data based on some condition and then use them for the visualization of data. Filters help in removing irrelevant data, reducing the size of data making it faster for processing.
There are mainly five types of filters in Tableau:
- Extract Filter
- Data Source Filter
- Context Filter
- Dimension Filter
- Measure Filter
Extract Filter
It is used to filter the extracted data from the available data source. Once your text file is connected to the data source, two options Live and Extract will be available in the top right corner. A live connection gets automatically connected to the data source. In Extract, connection data is extracted from the data source, and a local copy is created in Tableau Repository. To create an Extract Filter, follow the given below steps:
Step 1: Connect your text file with the Tableau and click on the Extract button. A local copy will also get created in the Tableau Repository.
Step 2: Click on the Edit option available near the Extract option. It will open an Extract Data window. Click on the button Add.
Step 3: A window named Add Filter will open. Select any one of the fields and add as Extract Filter. Click on the OK button. We have selected a Category field here.
Step 4: After you click on OK, a window named Filter [Category] will open. It will contain multiple options to filter based on various use cases.
Filter Conditions in Tableau:
Use Case 1: Select from List
By default, Select from List option appears. Members can be included or excluded as per the choice.
For including, select the members you want to include and click on OK.
For Excluding the selected members, click on the Exclude checkbox and then select the members you want to exclude. Click on OK.
Two more options are also available in Select from list option:
- All: It will include or exclude all the members.
To include, select All and click OK.
To exclude, click on the Exclude option. Select All option and click on OK.
- None: If you want to clear all the selection and start a new selection, select None option. It will clear all the selections made.
Use Case 2: Custom Value List
It allows the user to type the member name and filter accordingly. Click on Custom Value List, type the member name. Use + sign to add more members in the filter and click on OK.
Include All Values When Empty can be selected to include all the fields when there is no selected member.
Clear List will clear all the custom value list.
Use Case 3: Use all
It is used to select all the members on the list.
Use case 4: Wildcard
It is used to filter the fields based on the wildcard match. The different types of the match are:
- Contains: It will select the members if the member name contains typed characters.
- Starts with: It will select the members if the member name starts with typed characters.
- Ends with: It will select the members if the member name ends with typed characters.
- Exactly matches: It will select the members if the member name exactly matches with typed characters.
Select the Tab Wildcard. Type the characters you want to match. Select the type of match and click on OK.
Use Case 5: Filter on Condition
It is used to filter the data based on some condition.
- By Field: Select the tab Condition. Click on the radio button By Field. Select the name and the aggregate (Sum, Median, Average). Choose the operator. Enter the value and click on OK.
- The Range of Values: It will show the maximum and minimum value after clicking on the Load button.
Filter Condition by Formula:
A filter can be applied by using a formula. Click on the radio button By Formula. Enter the formula and click on OK.
Use Case 6: Top or bottom filters
This is used to select the top n or bottom n number of records.
By Field:
Select Tab Top and then By Field. Select either Top or Bottom. Choose the number of records, field, aggregation type, and click on OK.
By Formula: Select By Formula. Select either Top or Bottom. Choose the number of records, enter a formula, and click on OK.
Data Source Filter
This is used to filter the data in data source proportion. This filter is similar to Extract Filter, but they are not linked to each other. It also works on both Live and Extract. To create a Data Source Filter, follow the given below steps:
Step 1: Click on the Add button at the top right corner.
Step 2: It will open the Edit Data Source Filters window. Click on the Add button.
Step 3: A window named Add Filter will open. Select any one of the fields and add as Extract Filter. Click on the OK button. We have selected a Category field here.
Step 4: After you click on OK, a window named Filter [Category] will open. It will contain multiple options to filter based on various use cases.
Context Filter
It is an independent filter to create a separate dataset from the original dataset. Context filters are created because:
- It improves performance.
- It creates a dependent numerical or Top N Filter.
To create a Context Filter, select Add o Context option.
Step 1: Drag the Sub-Category to the Rows shelf and Scales to the Columns Shelf.
Step 2: Choose Horizontal Bar Chart from Show Me tab.
Step 3: Again, drag the Sub-category to the Filters Shelf.
Step 4: Right-click on Sub-category and click on the Edit Filter option. Go to the Top tab.
Step 5: Choose By Field option.
Step 6: Drag the Category to the Filter Shelf. Right-click on the Category field and choose Furniture.
Step 7: Add the Context Filter by right-clicking on the Category: Furniture filter.
Step 8: The result will show the subcategory of products under the category Furniture.
Dimension Filter: When Dimensions are used to filter the data, it is known as dimension Filter. Here, Dimensions, Groups, Sets, and Bins can be added. It can be applied through the top or bottom conditions, wildcard match, and formula.
The members can be included or excluded from the list using this filter. To create Dimension Filter, select a dimension and drag it into the Filters box. The Filter window will open. Select the members and click on OK.
It will show the records for only category Furniture.
Measure Filter: When Measures are used to filter the data, it is known as Measure Filter. To apply Measure Filter, select a measure and drag it into Filters box. Filter Field window will open. Select any of the aggregation and click on the Next button.
It will open a window where we need to select a range of values:
- Range Of Values: Minimum and Maximum Range.
- At Last: Minimum Value.
- At Most: Maximum Value.
- Special: Option to select null or non-null values.
Select the range. You can also modify the upper and lower limit. Click on OK.
Custom or Quick Filter: Filters can also be customized as per the user. It can customize worksheets and dashboards to modify the data dynamically. To customize the filter, add the Category Filter. Right-click on the filter and select the Show Filter.
It will show the members available.
You can exclude or include members.
User Filter
It will secure the row-level data. It can be used to publish the worksheet on the server. Suppose there are three departments in a firm named as Furniture, Office Supplies, and Technology. With the help of User filter, we can allow the users to show only the data relevant to their department.
To create a User Filter, follow the below steps:
Step 1: Click on the Server option > Create User Filter > Select the field (Here we are choosing Category).
Step 2: Tableau Server Sign-in window will get open. Click on the option Tableau Online.
Step 3: Enter the email-id and password. Click on the Sign-In button.
Step 4: User Filter window will open. Enter the name, select the user, check the members, and click on OK.
Step 5: User Filter will get created.