You are here:
Handle Null Numeric Values
When you create or update a dataset through your dataflow, recipe, or a CSV upload, for example, CRM Analytics replaces blank numeric values with the specified default value. When no default value is specified, CRM Analytics replaces blanks in numeric columns with 0 or null based on whether you enable null measure handling.
CRM Analytics replaces blanks with:
- 0 when null measure handling is disabled and no default value is specified
- null when null measure handling is enabled and no default value is specified
This behavior is important because CRM Analytics treats null and 0 differently. They aren’t the same. Null means that no value exists. 0 represents a value. Math operations performed on null results in null. For example,
10 + null = null
To return 0 instead of null in a math operation, you can use an expression similar to
this one: 10 + coalesce(null,0). For example,
10 + coalesce('Amount', 0), where Amount is
null.
Aggregate functions—such as sum, average, count, min, and max—exclude null values from calculations. To understand how 0 and null are treated differently with aggregate functions, consider the following customer satisfaction scores, where one score is missing for Customer2.
When CRM Analytics replaces the blank value with a zero, the average and minimum calculations are incorrect. When the replacement is null, the average and minimum calculations are correct.
Null measure handling allows the use of null values in these dataflow transformations.
| append | CRM Analytics can append datasets with different measure columns. For example, one dataset has an Amount column that is not present in a second dataset. After the append, the new dataset has an Amount column containing nulls in rows from the second dataset. Without null measure handling, appending datasets is not possible when measure columns are different. |
| augment | When the left key is null or has no match on the right, CRM Analytics inserts nulls in the columns added from the right. Without null measure handling, CRM Analytics inserts zeros for measures. |
| computeExpression | The |
| computeRelative | The |
| dim2mea | The |
| sfdcDigest | The |
| Update | CRM Analytics can update non-null values with nulls. |
delta transformation is not supported when
null measure handling is enabled and dataflows containing delta transformations fail. To
calculate changes in measure values over time, use computeRelative and computeExpression
transformations instead. For an example, see Handle Null Numeric Values .