KNOWLEDGE BASE

Replacing Null Literals


Published: 15 Dec 2016
Last Modified Date: 31 Jan 2018

Question

How to replace the word "Null" (Null literal) with a different string or blank space. 

Environment

Tableau Desktop

Answer

CLICK TO EXPAND SOLUTION
Option 1: Replace Null literal using Aliasing
  1. Right click the dimension field containing Null members Select 'Edit Aliases…'
  2. Locate Null and change to the expected string value. Type a space for a blank.
Alternately, to right click the Null value in view and select 'Edit alias…'
CLICK TO EXPAND SOLUTION
Option 2: Replace a null literal in the primary or only data source
  1. Select Analysis > Create Calculated Field
  2. Name the field, enter the following calculation, and click OK:

    IFNULL([Field Containing The Null Literal], 'string to replace the null literal')

    For example,

     

    IFNULL([Customer Name], '')
  3. Use the new field you created in place of the original field.
CLICK TO EXPAND SOLUTION
Option 3: Replace a null literal in a secondary data source (when data blending)
  1. From the view, select the primary data source.
  2. Select Analysis > Create Calculated Field
  3. Name the calculation, enter the following formula, then click OK:

     

    IFNULL(ATTR([Data Source Name].[Field Name])), 'string to replace the null literal')

    For example,

    IFNULL(ATTR([Sample - Coffee Chain (Access)].[State]), '')

  4. Use the new field you created in place of the original field.

If asterisks are shown in the view when blending with the secondary data source, see Troubleshooting Data Blending for more information. 
 

Additional Information

To view options 2 and 3 in action, see the video below. 
Note: Video is silent. 
Did this article resolve the issue?