Aggregates a flat dataset into one RollupEntry per distinct key.
The dataset to aggregate.
RollupOptions describing how to group and sum.
One entry per distinct grouping key, in first-seen order.
const byCustomer = rollup(invoices, { by: 'customer', value: 'revenue', metrics: { cost: 'cost' },}); Copy
const byCustomer = rollup(invoices, { by: 'customer', value: 'revenue', metrics: { cost: 'cost' },});
Aggregates a flat dataset into one RollupEntry per distinct key.