Loading

Null or Missing Data Produces Incorrect Average

Дата публикации: Feb 28, 2025
Описание
When averaging a field, then the result does not include NULL or missing data

Cause

Aggregations ignore NULL values. The function ZN() converts NULL values into zeros in order to be included in the average.

Решение
For NULL data, wrap the field in ZN(). For example, the following calculation:
AVG( [Sales] )

Could become:
AVG( ZN( [Sales] ))
 
For missing data it may not always be possible to replace missing values with zeros. Depending on how the view is built it may be possible to achieve the desired results with table calculations. For directions, please see Replace NULL or Missing Data With Zeros or Existing Data
Дополнительные ресурсы
Data Aggregation in Tableau
Logical Functions
Номер статьи базы знаний

001473468

Вложения

include NULL in avg.twbx

18 KB

 
Загрузка
Salesforce Help | Article