KNOWLEDGE BASE

How to avoid displaying NULL in single value filter choices


Published: 23 Dec 2022
Last Modified Date: 26 Dec 2022

Question

How to avoid displaying NULL in single value filter choices.

<Current behavior>
If there is a null in the field as a filter, then NULL will be displayed in the choices.
User-added image

<Desired behavior>
Exclude NULL from the choices.
User-added image

Environment

  • Tableau Desktop

Answer

<STEP 1>
-Create a chart and apply the filter-

1. Connect to attached data source 'Test_Sample - Superstore.xls' from Tableau Desktop.
2. Drag the 'Orders' sheet to palette.
3. In Sheet 1, Drag [Sales] to Columns -> Drag [Region] to Rows.
4. Drag [Sub-Category] to Filter pane -> Right click on [Sub-Category] on Filter pane -> Show Filter.
5. Click on Delta mark on Filter Legend -> Single Value List
User-added image

<STEP 2>
-Create Parameter Filter and hide NULL option-

6. Create a new Parameter as following.
*Need to enter 'All' in List of value.
User-added image
7. Right click on [Sub-Category Filter] -> Show Parameter.
8. Click on Delta mark on Parameter Legend -> Single Value List
User-added image
9. Delete [Sub-Category] in Filter pane.
10. Create a new calculated field as following.
       Name : Sub-Category (hide null)
       Calculation : [Sub-Category Filter] = "All"
                            OR
                            [Sub-Category Filter] = [Sub-Category]
                            OR
                            ISNULL([Sub-Category]) 
11. Drag [Sub-Category (hide null)] to Filter pane -> Check in only 'True'.
Did this article resolve the issue?