AggregationType
Declared in src/common/AggregationType.ts
A resolved aggregation type: its config, with its id and label.
#Definition
AggregationTypeConfig & {
id: string;
label: string;
}#Properties
#dataTypesAdaptableDataType[]
The data types of the columns the aggregation applies to. The UI only offers the aggregation for columns of these types. Omit it to allow every data type.
#done(accumulator: ACCUMULATOR, rows: DATA_TYPE[]) => any
Called once per group, after the last row. Returns the aggregated value. When omitted, the aggregated value is the accumulator.
#expressionrequiredstringalternative to reducer
#idrequiredstring
#initialValueACCUMULATOR | (() => ACCUMULATOR)
The accumulator for each group, before the first row. Pass a function to create a new object (an array, a Set) for every group.
#labelrequiredstring
Shown in the aggregation pickers and in the default header of pivot aggregation columns. Defaults to the id.
#reducerrequired(accumulator: ACCUMULATOR, value: any, data: DATA_TYPE) => ACCUMULATORalternative to expression
Called for every row of the group, with the cell value of the aggregated column and the row data. Returns the new accumulator.
#returnDataTypeAdaptableDataType
The data type of the aggregated value. Defaults to 'number'.