AggregatedExpressionFunction

Defines an AdapTableQL function that aggregates data

TypeScript
export interface

Properties

PropertyDescription
descriptionDescription of the Aggregated Expression Function
examplesExamples to use the Aggregated Expression Function
filterRowOptional 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.
initialValueMandatory Initial Value for the aggregation
inputTypesOptional argument types.
prepareRowValueCalled 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
processAggregatedValueCalled 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)
reducerMandatory Reducer function which is called for each value(row) in the Column Data
signaturesExample Signatures for the Aggregated Expression Function

Property Details

description

Description of the Aggregated Expression Function

TypeScript
description?: string;
Property Value

string

examples

Examples to use the Aggregated Expression Function

TypeScript
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.

TypeScript
filterRow?: (context: AggregatedExpressionFilterRowContext) => boolean;
Property Value

(context:AggregatedExpressionFilterRowContext) => boolean

initialValue

Mandatory Initial Value for the aggregation

TypeScript
initialValue: any;
Property Value

any

inputTypes

Optional argument types.

TypeScript
inputTypes?: ExpressionFunctionInputType[];
Property Value

ExpressionFunctionInputType[]

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

TypeScript
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)

TypeScript
processAggregatedValue?: (context: AggregatedExpressionProcessAggValueContext) => any;
Property Value

(context:AggregatedExpressionProcessAggValueContext) => any

reducer

Mandatory Reducer function which is called for each value(row) in the Column Data

TypeScript
reducer: (context: AggregatedExpressionReducerContext) => any;
Property Value

(context:AggregatedExpressionReducerContext) => any

signatures

Example Signatures for the Aggregated Expression Function

TypeScript
signatures?: string[];
Property Value

string[]