From 61789e173a5da9ef459a8215ae73d4da9d5a0864 Mon Sep 17 00:00:00 2001 From: Sergio Clebal Date: Wed, 29 Sep 2021 16:07:56 +0200 Subject: [PATCH] Error formatting FormulaWidget AVG values [sc-182582] --- packages/react-core/src/operations/aggregation/values.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-core/src/operations/aggregation/values.js b/packages/react-core/src/operations/aggregation/values.js index cdcebe55e..8a7879f01 100644 --- a/packages/react-core/src/operations/aggregation/values.js +++ b/packages/react-core/src/operations/aggregation/values.js @@ -20,5 +20,5 @@ export const aggregationFunctions = { [AggregationTypes.MIN]: (values, key) => min(values, key), [AggregationTypes.MAX]: (values, key) => max(values, key), [AggregationTypes.SUM]: (values, key) => sum(values, key), - [AggregationTypes.AVG]: (values, key) => sum(values, key) / values.length + [AggregationTypes.AVG]: (values, key) => sum(values, key) / (values.length || 1) };