Tableau Tutorials

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:

  1. Extract Filter
  2. Data Source Filter
  3. Context Filter
  4. Dimension Filter
  5. 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.

Tableau Extract Filters

Step 2: Click on the Edit option available near the Extract option. It will open an Extract Data window. Click on the button Add.

Tableau Extract Filters

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.

Tableau Extract Filters

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.

Tableau Extract Filters

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.

https://www.guru99.com/images/tableau/060818_0521_Filterdatai5.jpg

For Excluding the selected members, click on the Exclude checkbox and then select the members you want to exclude. Click on OK.

https://www.guru99.com/images/tableau/060818_0521_Filterdatai6.jpg

Two more options are also available in Select from list option:

  1. All: It will include or exclude all the members.

To include, select All and click OK.

https://www.guru99.com/images/tableau/060818_0521_Filterdatai7.jpg

To exclude, click on the Exclude option. Select All option and click on OK.

https://www.guru99.com/images/tableau/060818_0521_Filterdatai9.jpg
  1. 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.

https://www.guru99.com/images/tableau/060818_0521_Filterdatai11.jpg

Include All Values When Empty can be selected to include all the fields when there is no selected member.

https://www.guru99.com/images/tableau/060818_0521_Filterdatai12.jpg

Clear List will clear all the custom value list.

https://www.guru99.com/images/tableau/060818_0521_Filterdatai13.jpg

Use Case 3: Use all

It is used to select all the members on the list.

https://www.guru99.com/images/tableau/060818_0521_Filterdatai14.jpg

Use case 4: Wildcard

It is used to filter the fields based on the wildcard match. The different types of the match are:

  1. Contains: It will select the members if the member name contains typed characters.
  2. Starts with: It will select the members if the member name starts with typed characters.
  3. Ends with: It will select the members if the member name ends with typed characters.
  4. 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.

https://www.guru99.com/images/tableau/060818_0521_Filterdatai15.jpg

Use Case 5: Filter on Condition

It is used to filter the data based on some condition.

  1. 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.
https://www.guru99.com/images/tableau/060818_0521_Filterdatai16.jpg
  1. The Range of Values: It will show the maximum and minimum value after clicking on the Load button.
https://www.guru99.com/images/tableau/060818_0521_Filterdatai17.jpg

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.

https://www.guru99.com/images/tableau/060818_0521_Filterdatai18.jpg

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.

https://www.guru99.com/images/tableau/060818_0521_Filterdatai20.jpg

By Formula: Select By Formula. Select either Top or Bottom. Choose the number of records, enter a formula, and click on OK.

https://www.guru99.com/images/tableau/060818_0521_Filterdatai21.jpg

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.

Tableau Data Source Filters

Step 2: It will open the Edit Data Source Filters window. Click on the Add button.

Tableau Data Source Filters

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.

Tableau Data Source Filters

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.

Tableau Data Source Filters

Context Filter

It is an independent filter to create a separate dataset from the original dataset. Context filters are created because:

  1. It improves performance.
  2. 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.

Tableau Context Filters

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.

Tableau Context Filters

Step 6: Drag the Category to the Filter Shelf. Right-click on the Category field and choose Furniture.

Tableau Context Filters

Step 7: Add the Context Filter by right-clicking on the Category: Furniture filter.

Tableau Context Filters

Step 8: The result will show the subcategory of products under the category Furniture.

Tableau Context Filters

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.

https://www.guru99.com/images/tableau/060818_0521_Filterdatai30.jpg

It will show the records for only category Furniture.

https://www.guru99.com/images/tableau/060818_0521_Filterdatai31.jpg

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.

https://www.guru99.com/images/tableau/060818_0521_Filterdatai32.jpg

It will open a window where we need to select a range of values:

  1. Range Of Values: Minimum and Maximum Range.
  2. At Last: Minimum Value.
  3. At Most: Maximum Value.
  4. Special: Option to select null or non-null values.

Select the range. You can also modify the upper and lower limit. Click on OK.

https://www.guru99.com/images/tableau/060818_0521_Filterdatai33.jpg

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.

https://www.guru99.com/images/tableau/060818_0521_Filterdatai34.jpg

It will show the members available.

https://www.guru99.com/images/tableau/060818_0521_Filterdatai35.jpg

You can exclude or include members.

https://www.guru99.com/images/tableau/060818_0521_Filterdatai36.jpg

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).

https://www.guru99.com/images/tableau/060818_0521_Filterdatai37.jpg

Step 2: Tableau Server Sign-in window will get open. Click on the option Tableau Online.

https://www.guru99.com/images/tableau/060818_0521_Filterdatai38.jpg

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.

https://www.guru99.com/images/tableau/060818_0521_Filterdatai40.jpg

Step 5: User Filter will get created.

https://www.guru99.com/images/tableau/060818_0521_Filterdatai41.jpg
Facebook Comments
Tags

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to top button
Close
Close