From 4414f4292f0c27a09fc43db4356108e513c9bcc1 Mon Sep 17 00:00:00 2001 From: Edoardo Sabadelli Date: Tue, 15 Oct 2024 10:38:19 +0200 Subject: [PATCH] fix: do not fill the table with N/A with cumulative values Simply render the original value for non cumulative types. The tooltip can be used when in doubt to know if a cell value is accumulated. --- src/modules/pivotTable/PivotTableEngine.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/modules/pivotTable/PivotTableEngine.js b/src/modules/pivotTable/PivotTableEngine.js index 9338f41ee..ff91360e8 100644 --- a/src/modules/pivotTable/PivotTableEngine.js +++ b/src/modules/pivotTable/PivotTableEngine.js @@ -1091,7 +1091,7 @@ export class PivotTableEngine { // only accumulate numeric (except for PERCENTAGE and UNIT_INTERVAL) and boolean values // accumulating other value types like text values does not make sense - if (acc !== VALUE_NA && isCumulativeValueType(valueType)) { + if (isCumulativeValueType(valueType)) { // initialise to 0 for cumulative types // (||= is not transformed correctly in Babel with the current setup) acc || (acc = 0) @@ -1108,13 +1108,9 @@ export class PivotTableEngine { acc += parseValue(rawValue) } - } else { - // show N/A from the first non-cumulative type and onwards - // only if a previous value is present (this is to avoid filling empty rows with N/A) - acc = acc ? VALUE_NA : '' - } - this.accumulators.rows[row][column] = acc + this.accumulators.rows[row][column] = acc + } return acc }, '')