KNOWLEDGE BASE

Displaying NULL Values When There Are No Values in the Data


Published: 20 Feb 2013
Last Modified Date: 19 Oct 2017

Question

How to display NULL values in the view when there are no values in the data set.

Environment

Tableau Desktop

Answer

  1. Open Tableau Desktop and select Analysis > Create Calculated Field to create a calculated field.
  2. In the Calculated Field dialog box that opens, enter a name for the field.
  3. In the Formula field, create a calculated field similar to the following:
    if zn(lookup([Measure], 0))=0 then NULL else [Measure] end
    where [Measure] is the measure being used in the view.
  4. Click OK.
  5. Drag this calculated field to the view.
  6. Right-click on the measure in the view and select Format.
  7. Under Special Values in the Format pane, type in the desired text.

Additional Information

The special values will not work when no data exists in the data set. This calculation makes the measure appear as NULL data even though no data exists in the data set.
Did this article resolve the issue?