This article lists Aggregate Functions that can be used within Template expressions.
Aggregation is an operation that combines values from multiple records into a single value.
Within Template expressions, aggregation is performed on a set of child records belonging to some parent Group. Aggregation is required anytime you need to write an expression that potentially references multiple records.
Please see the Aggregation in Templates guide for more information and examples.
For additional information on other functions and expressions in general, please see our Functions Guide and Expressions Guide.
Aggregation is performed slightly differently within Model Calculation expressions. Please see the Aggregation in Model Calculations guide for more information. Also note that the functions listed here only apply to Template expressions. A slightly different list of Aggregate Functions are available for Model Calculations.
These functions require the use of the 'Aggregate' or 'AggregateAll' prefix when referencing Groups & Headers. Please see the Aggregation in Templates guide for more information on the difference between Aggregate and AggregateAll:
[Aggregate.Group.Header]
[AggregateAll.Group.Header]
Calculates the average of the values.
average([Aggregate.Group.Header])
average([AggregateAll.Group.Header])
Counts the number of records where the specified Header contains data.
count([Aggregate.Group.Header])
count([AggregateAll.Group.Header])
Counts the number of records for the Group whether the specified Header contains data or not.
countrecords([Aggregate.Group.Header])
countrecords([AggregateAll.Group.Header])
Determines the first value from a list of values.
The ordering of records is important when using this function. Please see the Using Filter Groups to Sort & Filter topic within our Aggregation in Templates guide.
first([Aggregate.Group.Header])
first([AggregateAll.Group.Header])
Concatenates all values and separates them with a delimiter.
A format can specified to present numeric values in a desired format.
Please see our Text Formatting guide for more information on formatting codes.
The formatting code can not be left completely blank. If you do not want to use a formatting code, supply an empty string '' as seen in the example below.
Usage is similar to joinDistinct() - see example below.
join([Aggregate.Group.Header], formatting code, delimiter)
join([AggregateAll.Group.Header], formatting code, delimiter)
Concatenates unique values and separates them with a delimiter.
A format can be specified to present numeric values in a desired format.
Please see our Text Formatting guide for more information on formatting codes.
The formatting code can not be left completely blank. If you do not want to use a formatting code, supply an empty string '' as seen in the example below.
joinDistinct([Aggregate.Group.Header], formatting code, delimiter)
joinDistinct([AggregateAll.Group.Header], formatting code, delimiter)
Example:
joinDistinct([Aggregate.DepthRelatedExploratoryInformation.Logger], '', '+')
Determines the last value from a list of values.
The ordering of records is important when using this function. Please see the Using Filter Groups to Sort & Filter topic within our Aggregation in Templates guide.
last([Aggregate.Group.Header])
last([AggregateAll.Group.Header])
Determines the maximum value from a list of values.
max([Aggregate.Group.Header])
max([AggregateAll.Group.Header])
Determines the minimum value from a list of values.
min([Aggregate.Group.Header])
min([AggregateAll.Group.Header])
Orders a list in ascending order.
orderAsc([Aggregate.Group.Header])
orderAsc([AggregateAll.Group.Header])
Orders a list in descending order.
orderDsc([Aggregate.Group.Header])
orderDsc([AggregateAll.Group.Header])
Returns the sum of all values.
sum([Aggregate.Group.Header])
sum([AggregateAll.Group.Header])
(This article was formerly titled Log Only Functions.)