KNOWLEDGE BASE

Replacing Null Literals


Published: 15 Dec 2016
Last Modified Date: 06 Feb 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. 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. 
Did this article resolve the issue?