AggregatedExpressionFunction

Defines an AdapTableQL function that aggregates data

TypeScript
export interface

Properties

PropertyTypeDescription
descriptionstringDescription of the Aggregated Expression Function
examplesstring[]Examples to use the Aggregated Expression Function
filterRow(context:AggregatedExpressionFilterRowContext) => booleanOptional 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.
initialValueanyMandatory Initial Value for the aggregation
inputTypesExpressionFunctionInputType[]Optional argument types.
prepareRowValue(context:AggregatedExpressionPrepareRowValueContext) => number | string | Date | undefinedCalled 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(context:AggregatedExpressionProcessAggValueContext) => anyCalled 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(context:AggregatedExpressionReducerContext) => anyMandatory Reducer function which is called for each value(row) in the Column Data
signaturesstring[]Example 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[]