Skip to main content

Aggregator Functions

Legacy Feature

Starting from April 19, 2024, Business Calculation and Holistics Expression are no longer supported for new user signups, and are only be available for legacy use cases.

Holistics Expression is now replaced by AQL Expression with enhanced functionality.

Aggregators are functions that group values of multiple rows into a single summary value. They are equivalent to aggregation functions that SQL supports (SUM, COUNT, AVG, MAX, MIN,...).


count

count(field)

Description

Counts the total number of items in a group, not including NULL values.

Return type

Whole Number

Example

count(orders.id)


count_distinct

count_distinct(field)

Description

Counts the total number of distinct items in a group, not including NULL values.

Return type

Whole Number

Example

count_distinct(orders.id)


average

average(field)  

Description

Averages the values of items in a group, not including NULL values.

Return type

Vary

Example

average(orders.id)


min

min(field)      

Description

Computes the item in the group with the smallest numeric value.

Return type

Vary

Example

min(order_item.quantity)


max

max(field)  

Description

Computes the item in the group with the largest numeric value.

Return type

Vary

Example

max(order_item.quantity)


sum

sum(field)  

Description

Sums the total number of items in a group, not including NULL values.

Return type

Number

Example

sum(order_item.quantity)


median

median(field)   

Description

Computes the median of an expression, which is the value that the values in the expression are below 50% of the time.

Return type

Number

Example

median(order_item.quantity)


stdev

stdev(field)        

Description

Returns the standard deviation (sample) of the column created by expression unless expression defines a column of lists, in which case returns the standard deviation (sample) of each list. .

Return type

Number


stdevp

stdevp(field)       

Description

Returns the standard deviation (population) of the column created by expression unless expression defines a column of lists, in which case returns the standard deviation (population) of each list.

Return type

Number


var

var(field)          

Description

Returns the variance (sample) of the column created by expression unless expression defines a column of lists, in which case returns the variance (sample) of each list.

Return type

Number


varp

varp(field)         

Description

Returns the variance (population) of the column created by expression unless expression defines a column of lists, in which case returns the variance (population) of each list.

Return type

Number


Let us know what you think about this document :)