From a14ea35edec7c74f43ef3be320a2bccce5d01ab6 Mon Sep 17 00:00:00 2001 From: Edoardo Sabadelli Date: Fri, 18 Oct 2024 10:20:37 +0200 Subject: [PATCH] fix: only accumulate when total agg type is SUM For real this time :) --- src/modules/pivotTable/PivotTableEngine.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/pivotTable/PivotTableEngine.js b/src/modules/pivotTable/PivotTableEngine.js index 104e98aaf..ad798e686 100644 --- a/src/modules/pivotTable/PivotTableEngine.js +++ b/src/modules/pivotTable/PivotTableEngine.js @@ -1095,7 +1095,7 @@ export class PivotTableEngine { // accumulating other value types like text values does not make sense if ( isCumulativeValueType(valueType) && - totalAggregationType === AGGREGATE_TYPE_AVERAGE + totalAggregationType === AGGREGATE_TYPE_SUM ) { // initialise to 0 for cumulative types // (||= is not transformed correctly in Babel with the current setup)