Understanding the Supported Aggregate Functions

Five built-in aggregate functions allow summarizing rows in a row set. The most common use case is to calculate an aggregate value of a child collection in the context of a parent object.

The table below provides a description and example of the supported functions.

Supported Aggregate Functions

Aggregate Function

Description

Example (in Context ofTroubleTicket Parent Object

avg

Average value of an expression

ActivityCollection.avg('Duration')

min

Minimum value of an expression

ActivityCollection.min('Duration')

max

Maximum value of an expression

ActivityCollection.max('Duration')

sum

Sum of the value of an expression

ActivityCollection.sum('Duration')

count

Count of rows having a non-null expression value

ActivityCollection.count('Duration')