Aggregated Expression Functions

Summary

  • This page lists all the Aggregated Expression Functions shipped by AdapTable
  • These functions iterate over multiple valuues and return a single value (of any type)

AdapTableQL provides a large range of Aggregated Expression Functions.

These are available in Aggregation Expressions.

Standard Aggregations

AdapTable provides a large set of Aggregated Functions that can be used in Aggregated Expressions.

Hint

These Aggregation Functions are also used when displaying Cell Summaries and Row Summaries

Note

All these functions are Aggregation Scalar: recieving a Column (or array) as an input and returning a single value

FunctionExampleReturnsColumns
SUMSUM([col1])Sum of the Column ValuesNumeric
PERCENTAGEPERCENTAGE([col1])Percentage of Column ValuesNumeric
AVGAVG([col1])Average of Column ValuesNumeric
MINMIN([col1])Minimum value in ColumnNumeric, Date
MAXMAX([col1])Maximum value in ColumnNumeric, Date
MEDIANMEDIAN([col1])Middle value in ColumnNumeric
COUNTCOUNT([col1])Number of values in ColumnAll
MODEMODE([col1])Most popular value in ColumnAll
DISTINCTDISTINCT([col1])No. of distinct values in ColumnAll
ONLYONLY([col1])Value in Column if all distinctAll
STD_DEVIATIONSTD_DEVIATION([col1])Standard Deviation for ColumnNumeric
WEIGHTAVG([c1], WEIGHT([c2]))Used with AVG in Weighted AveragesNumeric

GROUP_BY & WHERE

2 additional Expression Functions keywords are often used in conjunction with Aggregation Expressions:

FunctionExampleDescription
GROUP_BYSUM([col1],GROUP_BY([col2]))Groups aggregation operation within rows that have the same value in the specified column
WHERESUM([col1])>5 WHERE [col2]='USD'Narrows scope of Aggregated Expression

Cumulative Aggregations

2 Expression Functions keywords are required when creating Cumulative Expressions:

FunctionExampleDescription
CUMULCUMUL(SUM([col1]))Performs cumulative aggregation (running total) with given aggregation operation over a provided column
OVERCUMUL(SUM([col1]),OVER([col2]))Defines accumulative dimension (order) for enclosing cumulative aggregation

Quantile Aggregations

3 Expression Functions keywords are available when creating Quantile Expressions:

Hint

Each of these Quantile Aggregations can also be provided with a GROUP_BY function

FunctionExampleDescription
QUANTQUANT([col1], 4)Enables aggregations to be placed into 'n' Quantile 'buckets'
QUARTILEQUARTILE([col1])Enables aggregations to be placed into 4 Quantile 'buckets'
PERCENTILEPERCENTILE([col1])Enables aggregations to be placed into 100 Quantile 'buckets'