KNOWLEDGE BASE

Removing Null Values from Filters Based on Secondary Data Sources


Published: 23 Jan 2014
Last Modified Date: 26 May 2017

Question

How to remove or hide null values from filters that are based on secondary data sources.

Environment

  • Tableau Desktop
  • Blended data

Answer

Option 1: Tableau Desktop 10.0 and newer versions

Join tables Instead of blending. Nulls do not appear in filters from primary data sources unless the data set contains Null values.
Note: Cross database joins are not available for all data sources. For more information, see Combine tables from different databases.

Option 2: Use Parameters Instead of Filters

Step 1: Build the View

  1. In Tableau Desktop, connect to the Superstore sample data.
  2. Select Data > Connect to Data, and then connect to the Coffee Chain sample data.
  3. In the Data pane, click the Superstore sample data.
  4. Drag State to Rows.
  5. In the Data pane, click the Coffee Chain sample data.
  6. Drag State to Rows.

Step 2: Create a Parameter

  1. In the Data pane, click the Coffee Chain sample data.
  2. Right-click in the Data window and then select Create Parameter.
  3. In the Create Parameter dialog box, do the following, and then click OK:
    • Name the parameter. In the example workbook, the parameter is named State Filter.
    • For Data Type, select String.
    • For Allowable values, select List.
    • Under List of values, click Add from Field, and then select Coffee Chain Extract > State.
  4. Right-click the new parameter and then select Show Parameter Control.

Step 3: Create a Calculated Field

  1. Select Analysis > Create Calculated Field.
  2. In the Calculated Field dialog box, do the following and then click OK:
    • Name the calculated field. In the example workbook, the calculated field is named State Filter On/Off.
    • In the formula field, create a calculated field similar to the following:
      IF [State] = [State Filter] THEN "Yes" ELSE "No" END
  3. Drag the newly created calculated field from Dimensions to Filters.
  4. In the Filter dialog box that opens, select Yes, and then click OK.


 
Did this article resolve the issue?