Filters in Tableau

You can use filters in the Tableau worksheet to restrict the number of records present in the dataset. Depending on your requirements you can use different types of filters as given below.

  1. Extract Filters : This filter is used to filtering the extracted data from the data source.
  2. Data Source Filters: It is used to filter the data at the data source level. It can restrict the records present in the data set.
  3. Context Filters: This filter is an independent filter that can create a separate dataset out of the original data set
  4. Dimension Filters: This filter is used to filter the dimension variable from the worksheet.
  5. Measure Filters: This filter is used to filter the Measure variable from the worksheet.
  6. Date Filter: Date filters used to filter dates from the date field.

Tableau Bubble Chart

Extract Filters in Tableau

  • Extract Filter is used to filtering extracted data from the downloaded data source.
The Live and Extract options are available only in the Tableau Desktop official version.
  • Open Tableau and click on Connect to Data.
    connect-to-data-tableau
  • Then the Connect page will open, click on Microsoft Excel.
    click-on-connect-to-data-excel-file-tableau
  • Navigate to the downloaded files, select P1-OfficeSupplies excel file, which is a saved excel file, and click on Open.
    connect-p1-oofice-supplies-tableau
  • You can download a Sample Superstore.xls excel file from the link: https://chercher.tech/files/
  • Once the data source has been connected, open a new worksheet by clicking on sheet1.
    naviagte-to-sheet1-tableau
  • You can see the Live and Extract options are at the top right corner of the Tableau Desktop workspace

live-and-extract-options-tableau

  • The Live option directly connects to the live data source, where the Extract option extracts the data from the data source which you have already downloaded.
  • After connecting the excel file to Tableau, click on the Extract radio button, this will create a local copy in the repository.
    select-extract-radio-button
  • Next, click on the Edit option which is present near the Extract radio button, this opens the Extract Data window.
  • Click on the Add option present inside the window.
    click-on-edit-and-add-option
  • The Add Filter window will open, select the filter conditions, you can select any of the fields and add as extract filter.
  • In this example, I have selected the Order Date as extracted filter and then click on Ok.
    select-order-date-in-add-filter
  • Once you click on Ok, it opens the Filter Field window, select the respective field(Here I have selected Years) to filter, and click Next.
    filter-field-window-taleau
  • After clicking on Next, the Filter window will open, it has several options to filter Order Date based on various use cases. All the use cases and their filter conditions are explained below.

to-include-select-member-and-click-ok

Data Sorting in Tableau

Filter Conditions with Use Cases in Tableau

For all the use cases, Follow the steps from connecting the Data source to Tableau till You get the Filter window.

Use case 1: Select From List
  • Once the Filter window opens, by default the Select From List option is selected, here, you can include or exclude the members present in the field using this option.
  • To Include, you can select the member and then click OK.
    to-include-select-member-and-click-ok
  • To Exclude, select the member and then click on the Exclude check box and then click OK.
    exclude-member-from-list
  • There are two more options that are present in the Select From List, All and None.
  • Selecting the All options will include or excludes all the members from the list.
  • Selecting the None option will clear all the previous selections and make new selections.
Use case 2: Custom Value List
  • Once the Filter window has opened, select the Custom value list radio button.
  • The Custom value list allows the user to enter the member name and filter the field accordingly.
  • In the filter screen,
    • Click on the customs value list radio button
    • Type the member name
    • Click on the + symbol to add multiple members to the list and click Ok
      custom-value-list
  • You have an option called, include all the values when empty, this will include all the values present in the filed when the selected member has no data.
    select-include-all-values-when-empty
  • And the Clear List clears the custom value list.
    clear-list-option
Use Case 3: Use All
  • Once the Filter window has opened, select the Use All radio button.
  • The Use All option will select all the members present in the data field.
    use-all-option-in-filter
Use Case 4: Filter by Condition

Next, you have an option called filter by the condition. This option is used to filter the data source by giving several conditions.


The Procedure to filter by the condition is as follow :

  • Open Tableau and click on Connect to Data.
    connect-to-data-tableau
  • Then the Connect page will open, click on Microsoft Excel.
    click-on-connect-to-data-excel-file-tableau
  • Navigated to the downloaded files, select P1-OfficeSupplies excel file, which is a saved excel file, and click on Open.
    connect-p1-oofice-supplies-tableau
  • You can download a P1-OfficeSupplies excel file from the link: https://chercher.tech/files/
  • Once the data source has been connected, open a new worksheet by clicking on sheet1.
    naviagte-to-sheet1-tableau
  • Once the file has been connected, click on the Extract radio button and then click on Edit.
    click-extract-edit-tableau
  • Click on Add in the Extract Data window.
    click-add-extract-data-window-tableau
  • Next, select the element Order Date which you want to filter and click on OK.
    select-order-date-click-ok-tableau
  • Next, select years from the filter field and then click on Next.select-years-clcik-next-tableau
  • Next, the Filter[Year Of Order Date] window will open.
  1. Select the Condition option in the Filter[Year Of Order Date] window. filters-by-condition-tableau
  2. Click on the radio button By field
    selecting-elements-by-condition-tableau
  3. Select the name of the field (Unit Price )to be filtered from the drop-down list.
  4. Select the aggregation type like Count from the drop-down list.
  5. Choose the operator from the drop-down(=).
  6. Enter the value to filter the selected field(200).
  7. Click on OK.
  • In the above example, the dataset is filtered to see the data, where, the unit price count is equal to 200.

The range of Values :

  • This option shows the minimum and maximum value of the selected field by clicking on the Load button. It can be used to refer to the values.
    click-on-load-to-load-value
Use Case 5: Filter Condition by Formula :

You can write a formula to filter the dataset using this option. The procedure is explained below.

  • Click on the By Formula radio button.
    filters-condition-formula-tableau
  • Enter the formula in the box.
  • Click on Ok.
Use Case 6: Top filters

This option is used to select the top or bottom 'n' number of records.

By Field :

  1. Select the Top tab from the filter window.
  2. Click on the By Field radio button. filter-by-top-and-by-field
  3. Select Top or Bottom from the drop-down
  4. Choose the number of records(I have selected 10).
  5. Select the field(Top).
  6. Choose the aggregation type(Count).
  7. Click on Ok. filtering-by-top-tableau

By Formula :

The top or bottom condition can also be given through the formula.

  1. Click on the By Formula radio button.
    1. Select Top or Bottom.
    2. Choose the number of records(10).
    3. Enter the formula.
    4. Click on OK.
      filter-top-by-formula

Formatting in Tableau

Data Source Filter in Tableau

  • It is used to filter the data at the data source level.
  • It can restrict the records present in the data set.
  • This filter is similar to the extract filter on securing the data.
  • But the data source filter and extract filters are not linked to each other.
  • The Data source filter works on both the live and extract connection.
  1. Open Tableau and click on Connect to Data. connect-to-data-tableau
  2. Then the Connect page will open, click on Microsoft Excel.
    click-on-connect-to-data-excel-file-tableau
  3. Navigated to the downloaded files, select P1-OfficeSupplies excel file, which is a saved excel file, and click on Open. connect-p1-oofice-supplies-tableau
  4. You can download the P1-OfficeSupplies.xls excel file from the link: https://chercher.tech/files/
  5. Once the data source has been connected, open a new worksheet by clicking on sheet1. naviagte-to-sheet1-tableau
  6. Once the tableau workspace has opened, click on Add.
    click-on-add-button-tableau
  7. After clicking on Add, the Edit Data Source Filters window will open.
  8. Click on Add... Option present t in the window as below. clikc-add-in-edit-data-source-filter-window-tableau
  9. After clicking on the Add... button.
  10. The Add Filter window will open to select the filter conditions, you can select any of the fields and add as extract filter.
  11. In this example, I have selected the Order Date as extracted filter and then click on Ok. select-order-date-in-add-filter
  12. Once you click on Ok, it opens the filter field window, select the respective filed(Here I have selected Years) to filter, and click Next. filter-field-window
  13. The filter window has two options to filter Order Date based on years. All the use cases and their filter conditions are explained in the Extract filter section.

Field Operations in Tableau

Context Filter in Tableau

A Context filter is an independent filter that can create a separate dataset out of the original data set and compute the selections made in the worksheet.

One or more category filter that separates the dataset into major parts can be used as a context filter.

All other filters used in the worksheet works based on the selection of context filters. The functions of context filters can be explained through an excel sheet.

  • To demonstrate the context filter, I am using the Sample Superstore.xls excel file.
  • Open Tableau and click on Connect to Data.
    connect-to-data-tableau
  • Then the Connect page will open, click on Microsoft Excel.
    click-on-connect-to-data-excel-file-tableau
  • Navigate to the downloaded files, select Sample Superstore.xls excel file, which is a saved excel file, and click on Open.
    connect-sample-superstore-to-tableau
  • You can download a Sample Superstore.xls file from the link: https://chercher.tech/files/
  • Once the data source has been connected, open a new worksheet by clicking on sheet1.
    naviagte-to-sheet1-tableau
  • The Sample Superstore excel file contains the below details.
    sample-superstore-excel-file-tableau
  • Drag the dimension Sub-Category to the Rows shelf and the measure Sales to the Columns Shelf.
    drag-sub-category-and-sales-tableau
  • Drag the dimension Sub-Category again to the Filters shelf. You will get the following chart.
    drag-sub-category-into-filter-shelf-tableau
  1. Next, right-click on the sub-category in the filter shelf and select the Top tab.
  2. Choose the option by field.
  3. From the next drop-down, choose the option Top.
  4. Select the number of records from the dropdown (10).
  5. Next, select Sales.
  6. Select aggregation Sum as shown in the following screenshot.
  7. Next, click on OK.

select-top-by-field-tableau

  • Next, It will navigate you to the worksheet, Drag the Category option under dimension to the filter shelf.
  • As soon as you drag, the Filter[category] window will open.
  • Select the Furniture under the General tab and click Ok.
    category-to-filter-shelf-select-furniture-tableau
  • Once you click Ok, you will find the below graph.
    from-genral-furniture-category-tableau
  • Right-click on the Category: Furniture in the filters shelf and select the option Add to Context.
  • This produces the final result, which shows the subcategory of products from the category Furniture which are among the top 10 subcategories across all the products.
    right-click-category-and-select-add-to-context-tableau
  • Now the category: furniture will be added to the context filter.
    furniture-category-added-to-context-filter-tableau
  • When you use the context filter in a large data source, context can improve the performance as it creates a temporary dataset part based on the context filter selection.
  • Context filters can be used to create dependent filter conditions based on your business requirement.
  • When your data source size is large, the context filter can be selected as a major category, and other relevant filters can be executed.

Tableau Story Line

Dimension Filters in Tableau

  • When a dimension is used to filter the data in the worksheet, it is called a dimension filter.
  • Using this filter, you can include or exclude the members in the dimension.
  • Below examples include filtering based on categories of numeric values or text values with logical expressions less than, or greater than conditions.
  • In dimension filters, you can use only values to filter.
  • To demonstrate the dimension filter, I am using Sample Superstore.xls excel file,
  • Open Tableau and click on Connect to Data.
    connect-to-data-tableau
  • Then the Connect page will open, click on Microsoft Excel.
    click-on-connect-to-data-excel-file-tableau
  • Navigate to the downloaded files, select Sample Superstore,xls excel file, which is a saved excel file, and click on Open.
    connect-sample-superstore-to-tableau
  • You can download a Sample Superstore.xls file from the link: https://chercher.tech/files/
  • Once the data source has been connected, open a new worksheet by clicking on sheet1.
    naviagte-to-sheet1-tableau
  • The Sample Superstore excel file contains the below details.
    sample-superstore-excel-file-tableau
  • Once the data source has been connected to the Tableau, drag the Order sheet to the workspace.
  • Next, click on the Sheet1, it will navigate you to the Sheet1 worksheet.
  • Here we are applying the dimension filter on the Sub-category of the products
  • So, we have to create a view on the profit for each sub-category of products according to their shipping mode.
    • Drag the dimension field Sub-Category and Shipping Mode to the rows shelf respectively.
    • The measure field profit to the Columns shelf.
      drag-diemnsion-field-and-measure-field-tableau
  • Next, drag the Sub-Category dimension to the Filters shelf to open the Filter dialog box. And, click on the None button at the bottom of the list to deselect all segments.
    deselect-all-segments-and-click-none-tbaleau
  • Select the Exclude option in the lower right corner of the dialog box and select Labels and Storage and click on the OK button.
    select-label-storage-click-exclude-tableau
  • The below graph shows the result with the two excluded fields(Labels and Storage).
    view-with-excluded-lables-and-stoage-fields-tableau

Tableau Data Types

Measure Filters in Tableau

You can use a measure filter to filter the data based on the values present in a measure. The aggregated measure values can be used in the measure filter to modify the data.

The following example demonstrates the Measure Filter:

  • Open Tableau and click on Connect to Data.
    connect-to-data-tableau
  • Then the Connect page will open, click on Microsoft Excel.
    click-on-connect-to-data-excel-file-tableau
  • Navigated to the downloaded files, select Sample Superstore.xls excel file, which is a saved excel file, and click on Open.
    connect-sample-superstore-to-tableau
  • You can download a Sample Superstore.xls excel file from the link: https://chercher.tech/files/
  • Once the data source has been connected, open a new worksheet by clicking on sheet1.
    naviagte-to-sheet1-tableau
  • The Sample Superstore excel file contains the below details.
    sample-superstore-excel-file-tableau
  • We have to apply a dimension filter on the average value of the Profit.
  • Create a view by drawing the Profit variable to Column and Sub-Category to the row-column.
    create-view-with-profit-and-sub-category-tableau
  • Next, drag the Profit variable to the Filter shelf, A Filter Field[Profit] window will open, select the Average, and click Next.
    select-average-filter-field-window-tableau
  • Once you click on Next, you will navigate to the Filter[Avg. Profit] window, Select At least and give value to filter the rows, which meet this criterion and click on the OK button.
    select-atleast-click-ok-tableau
    • Range of Values : 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.
  • Once you click on Ok, you will get the final view that showing only the sub-categories whose average Profit is greater than 25 in the below image.
    graph-with-filtered-measure-value-tableau

Forecasting in Tableau

Filter Dates in Tableau

Tableau provides a date field in three different ways while applying the date field. We can apply a Date filter by taking a relative date as compared to Today, A perfect date, or a range of dates.

Each of these options available when a date field is dragged out of the filter pane.

The following example demonstrates the Filter Date :

  • Open Tableau and click on Connect to Data.
    connect-to-data-tableau
  • Then the Connect page will open, click on Microsoft Excel.
    click-on-connect-to-data-excel-file-tableau
  • Navigate to the downloaded files, select Sample Superstore.xls excel file, which is a saved excel file, and click on Open.
    connect-sample-superstore-to-tableau
  • You can download a Sample Superstore.xls excel file from the link: https://chercher.tech/files/
  • Once the data source has been connected, open a new worksheet by clicking on sheet1.
    naviagte-to-sheet1-tableau
  • The Sample Superstore excel file contains the below details.
    sample-superstore-excel-file-tableau
  • Create a view by dragging the Order date to the column shelf and Profit to the row shelf.
    create-a-view-with-order-date-and-profit-tableau
  • Drag the Order Date field to the filter shelf and choose the Range of dates in the filter dialog box and click on the Next button.
    select-range-of-orders-tableau
  • Next, select the Range of dates and click on the OK button as shown below.
    select-range-of-dates-click-ok-tableau
  • Now, you will get a graph which shows you the selected range of dates as below.
    a-graph-with-range-of-order-date-tableau
0 results
Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions