KNOWLEDGE BASE

Replacing Null Literals


Published: 15 Dec 2016
Last Modified Date: 02 Mar 2017

Question

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

Environment

Tableau Desktop

Answer

Option 1: To 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([Sales], 'None')
  3. Use the new field you created in place of the original field. 


Option 2: To 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([Secondary].[Customer Segment]), 'Other')
  4. Use the new field you created in place of the original field. 
If asterisks are showed in the view when blending with the secondary data source, see Troubleshooting Data Blending for more information. 

Additional Information

To view the above steps in action, see the video below: 
Did this article resolve the issue?