Preliminary note: In this article, “0” and “zero” are used interchangeably here. Both denote an explicitly stored value, in contrast to “empty” or “null”, which denote an empty, not-existing value.
As of Jedox 7.0, the Jedox OLAP Server can optionally store zero (0) values in cubes. This storage can be enabled for individual cubes; by default, it is not enabled.
Prior to Jedox 7.0, the Jedox OLAP Server did not differentiate whether a numeric base cell in a cube was completely empty, or held the value 0. If a user entered 0 as value on a base cell, that cell value was deleted from the cube storage in memory. The same happened for a set of base cells if the user splashed a 0 as value on their parent cell.
However, in some usage scenarios, a zero value in a cell has a different informational value than if the cell is completely empty. For these scenarios, the new option to store zero values has been introduced.
With regard to used memory of a cube, a stored 0 is a value just like any other stored numeric value. It doesn’t consume more or less memory than any other cell.
1. Enable storage of zero values
The option to store zero values is enabled for each cube on an individual basis. The setting is made in the “Advanced” section of Cube Properties in the Modeler:
After enabling the option, the existing empty cells in the cube will not be automatically converted to 0 values. They will remain empty until new 0 values are entered. Note: when the option is disabled on a cube, all existing base cell 0 values will be deleted. This change can not be undone!
The “Number of filled cells” value in the “Information” section of a cube includes any stored 0 values.
2. Behavior when viewing/reading cube values
If the “Store Zero Values” option is not enabled for a cube, the output of cell values in PALO.DATA|C|V formulas is comparable with Jedox 6.0. A “0” will be visible as a value for all empty cells. However, if the option “Store Zero Values” is enabled, the output of these formulas changes:
- If the cell is empty, the PALO.DATA() formula will display an empty string in the cell. The actual cell value is an empty string.
- If the cell value is a real stored 0, the formula will show a 0 as a value. If one of the base cells underneath an aggregated element has the value 0, and all other base cells are empty, the consolidated value will also be 0, and is shown as 0.
- Certain formula calculations on such cells will return different results, depending on whether the value is empty or 0. A SUM() formula result would be identical. However, an AVERAGE() formula would return a different result: it would not consider an empty value for its result, but would consider a 0 value.
- In Jedox Web, if the data range for a line chart includes an empty value, the value would not be plotted at all in the line chart. By contrast, a 0 value would be plotted at data point 0 on the data axis of the chart.
This distinction is also true for rule-calculated values (see section 4.2 below).
A view in Jedox Excel Add-In on a cube where the “Store Zero Values” option is enabled.
The value for “Feb” and “2019” is a stored 0; the aggregated value for “Qtr. 1” is also 0.
When exporting a cube, the “Ignore empty cells” option is relevant for the storage of zero values. If this option is not set, the export returns all cells for the defined slice, which is the same behavior as in Jedox 6.0 or earlier. If the “Ignore empty cells” option is set, the export will not include empty (or “null”) cells. However, it will include cells with the value 0.
3. Writeback behavior
If the option to store zero values is not enabled for a cube, the writeback behavior is backwards compatible with previous versions of Jedox; in other words, when writing zeroes, cube results will be like in earlier Jedox versions. If a user writes 0 in a cell, the cell is deleted. The same happens if the user splashes zeros, or if zero values are included in an ETL load.
Jedox Excel Add-in and Jedox Web (in the Reports component) also offer the option to delete a cell by using the Delete key on the cell (in Excel: Ctrl + Delete). This behavior also stays as before.
If the option to store zero values is enabled, the writeback behavior changes. If the user enters a 0 in a base cell, this 0 is now stored as a value in the OLAP cube. In aggregated cells, if the user splashes a 0 (with #0), the base cells will still be deleted, which prevents users (who may not be aware that the option is used) from accidentally creating a large number of stored 0 values. To splash zeros on an aggregated cell, the new input commands #00 and !00 should be used.
The DEL key (CTRL + DEL in Excel) deletes cell values (on base or aggregated level). During “copy” operations, 0 values in the source are copied to the target area.
4. Rule calculation
Rules can use empty or 0 values in several ways. For example, a rule could include an IF() function that checks whether a value is 0: IF(… == 0,…,…). Also, a rule could return 0 as a value.
Rule calculation is also impacted by the OLAP server’s ability to differentiate 0 values and empty values. The rule calculation engine in Jedox 7.0 uses a consistent approach, regardless of whether a cube has been enabled to store zero values or not. However, there is some impact in regard to backwards compatibility for database models, and specifically for rules created with Jedox 6.0 or earlier versions.
Generally, the OLAP server in Jedox 7.0 introduces a new constant value in rule definition: null. This constant denotes a non-existing value. In terms of operations (see section 4.1 below), it is regarded as identical to the values 0 or “”; but in output of rules, it is different.
The Marker Index treats stored 0 values like any other numeric value; base cells holding 0 value are indexed by a Rule Marker.
4.1 Value comparison in rules
When doing value comparison in rules using the == operator, zeros, nulls, and empty strings are regarded as the same value. So the following expressions are all true: 0 == null, 0 == “”, and null == “”.
To see whether a value returned from a PALO.DATA function (also its shorthand syntax, [‘…’]) is empty, a new rule function has been introduced: ISNULL(). This function returns a value of “true” if the cell value is empty and a value of “false” if the value is 0.
This approach ensures that comparisons in rules are backwards compatible. A comparison [‘…’] == 0 would return a value of “true” in Jedox 6.0 or earlier if the cell value didn’t exist. It will return “true” as well in Jedox 7.0, regardless of whether the cell value is empty or 0 (the latter only being possible if the cube has “Store Zero Values” option enabled).
4.2 Output of values in rules
The output of a rule is different in cubes having the option “Store Zero Values” enabled, depending on whether the rule returns 0 or null.
Consider the following simple rule: [‘2019’] = 0. Spreadsheet cells for which this rule is calculated display the value “0” (same as in previous versions), regardless of whether the “Store Zero Values” option is enabled or not. By contrast, the rule [‘2019’] = null would show up as a dash in a spreadsheet cell if “Store Zero Values” is enabled. If the option is disabled, the cell would also show “0” as value.
Important: when exporting a cube, values from rules that return 0 are not filtered out by the “Ignore empty cells” option, regardless of whether the “Store Zero Values” option is set or not. Values from rules that are null (empty) are filtered out. To also filter out 0 values from rules, cube extracts in Jedox Integrator introduce a new filter option, “excludeEmptyAndZero”. Details can be found in the article Handling of NULL Values in Jedox Integrator.