How to replace NULL or missing data with zeros or existing data using the ZN function in Tableau

preview_player
Показать описание
In this silent video you’ll learn how to do use ZN() function to replace NULL or missing data with zeros or existing data in Tableau.

- - - - - - - - - - - - - -

1. Select Analysis and then Create Calculated Field
2. In the Calculated Field dialog box that opens, Name the calculated field. In this example, the calculated field is named "Replace empty cells with zero (opt 1)", enter the formula similar to the suggestion in the article and then click OK.
NOTE: The ZN() function will replace any NULL values with zero
3. In the Calculated Field dialog box that opens, Name the calculated field. In this example, the calculated field is named "Replace empty cells with last value (opt 1)", enter the formula similar to the suggestion in the article and then click OK.
NOTE: IFNULL(..., PREVIOUS_VALUE(0)) will replace any NULL values with the last value of this calculation, which creates a running last value. Depending on how the view is built, it may be necessary to compute PREVIOUS_VALUE() differently. See Transform Values with Table Calculations
4. Replace [Amount] on Text on the Marks card with either [Replace empty cells with zero (opt 1)] or [Replace empty cells with last value (opt 1)] depending on the desired end result
5. (Optional) Customize the values in the view by right-clicking the value and formatting it as desired.

Related solutions:

- - - - - - - - - - - - - -

Рекомендации по теме