the top-level groups of groupRows
key → aggregator ({ umsatz: "sum" }, see AggregateSpecMap)
Optional accept: ((sourceIndex) => boolean)a filter: only rows it accepts count (index into the source rows)
the totals over all groups
const groups = groupRows(sales, ["region", "produkt"]);
const totals = aggregateRowGroups(groups, { umsatz: "avg" });
groups[0].results.umsatz; // 90 – Nord: (100 + 50 + 120) / 3, not the mean of A (110) and B (50)
totals.umsatz; // 75
1.1.94
Computes the aggregates of all groups (RowGroupIf.results) and their row counts (RowGroupIf.count). A group of the last level aggregates its rows; every group above merges the states of its sub-groups – an average stays the average of all rows (sum and count are merged), never the average of averages.