How to replace NULL or missing data with zeros or existing data using a parameter in Tableau

preview_player
Показать описание
In this silent video you’ll learn how to do to replace NULL or missing data with zeros or existing data by using a parameter in Tableau.

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

This option will replace NULL data and data that has been filtered out of the view with zeros.

1. Click the down arrow next to Dimensions in the data pane and select Create Parameter…
2. In the Create Parameter dialog, do the following and click OK:
2. a. Name the parameter. In this example I will call it "Date Parameter"
2. b. For Data Type, select Date
2. c. For Allowable values, select All
3. Right-click [Date Parameter] in the data pane and select Show Parameter Control
4. Select Analysis and then Create Calculated Field
5. In the Calculated Field dialog box that opens, Name the calculated field. In this example, the calculated field is named "Filtered Amount or zero (opt 2)", 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
6. In the Calculated Field dialog box that opens, Name the calculated field. In this example, the calculated field is named "Filtered Amount or last value (opt 2)", 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.
7. Replace [Amount] on Text on the Marks card with the desired new value depending on the desired end result
8. Remove [Date] from the Filters shelf
9. (Optional) Customize the values in the view by right-clicking the value and formatting it as desired.

Related solutions:

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

Рекомендации по теме
welcome to shbcf.ru