AggregatedExpressionFunction
Defines an AdapTableQL function that aggregates data
export interfaceProperties
| Property | Description |
|---|---|
| description | Description of the Aggregated Expression Function |
| examples | Examples to use the Aggregated Expression Function |
| filterRow | Optional filter which is applied to each row before the reducer is called. If the filter returns false, the row is NOT included in the aggregation. |
| initialValue | Mandatory Initial Value for the aggregation |
| inputTypes | Optional argument types. |
| prepareRowValue | Called for each row AFTER the reducer() and processAggregatedValue() functions Can be used when each row has a different aggregated value (e.g. percentage = row value / aggregated value). Returns return value for each individual row |
| processAggregatedValue | Called AFTER the reducer() has processed all values / rows Can be used to change result of reducer based on the values array (e.g. average = aggregated value / count) |
| reducer | Mandatory Reducer function which is called for each value(row) in the Column Data |
| signatures | Example Signatures for the Aggregated Expression Function |
Property Details
description
Description of the Aggregated Expression Function
description?: string;Property Value
string
examples
Examples to use the Aggregated Expression Function
examples?: string[];Property Value
string[]
filterRow
Optional filter which is applied to each row before the reducer is called. If the filter returns false, the row is NOT included in the aggregation.
filterRow?: (context: AggregatedExpressionFilterRowContext) => boolean;Property Value
(context:AggregatedExpressionFilterRowContext) => boolean
initialValue
Mandatory Initial Value for the aggregation
initialValue: any;Property Value
any
inputTypes
Optional argument types.
inputTypes?: ExpressionFunctionInputType[];Property Value
prepareRowValue
Called for each row AFTER the reducer() and processAggregatedValue() functions Can be used when each row has a different aggregated value (e.g. percentage = row value / aggregated value). Returns return value for each individual row
prepareRowValue?: (context: AggregatedExpressionPrepareRowValueContext) => number | string | Date | undefined;Property Value
(context:AggregatedExpressionPrepareRowValueContext) => number | string | Date | undefined
processAggregatedValue
Called AFTER the reducer() has processed all values / rows Can be used to change result of reducer based on the values array (e.g. average = aggregated value / count)
processAggregatedValue?: (context: AggregatedExpressionProcessAggValueContext) => any;Property Value
(context:AggregatedExpressionProcessAggValueContext) => any
reducer
Mandatory Reducer function which is called for each value(row) in the Column Data
reducer: (context: AggregatedExpressionReducerContext) => any;Property Value
(context:AggregatedExpressionReducerContext) => any
signatures
Example Signatures for the Aggregated Expression Function
signatures?: string[];Property Value
string[]