The built-in aggregators by name (AggregatorName) – each one is an AggregatorIf, so merge combines
partial results correctly (the average of groups is the average of all rows).
sum and avg sum with compensation (Neumaier): 0.1 + 0.2 + 0.3 is 0.6, and splitting the data into groups
does not change the result.
Numeric aggregators use numbers only (NaN, text, null … are ignored); min/max also valid Dates;
count counts rows; countDistinct ignores null/undefined; first/last take the value as it is.
Example
const { sum } = Aggregators; letstate = sum.init(); for (constorderoforders) state = sum.add(state, order.total); sum.result(state); // the same as aggregate(orders, "total", "sum")
The built-in aggregators by name (AggregatorName) – each one is an AggregatorIf, so
mergecombines partial results correctly (the average of groups is the average of all rows).sumandavgsum with compensation (Neumaier):0.1 + 0.2 + 0.3is0.6, and splitting the data into groups does not change the result.NaN, text,null… are ignored);min/maxalso validDates;countcounts rows;countDistinctignoresnull/undefined;first/lasttake the value as it is.