Aggregate Functions
Learn about the aggregate functions supported by Export ZOQL, including avg(), count(), max(), min(), and sum(), along with their limitations and examples.
Overview
As of release 34.0, Export ZOQL supports several aggregate functions, detailed below.
Export ZOQL is used for creating exports from Zuora data sources, and uses a different syntax than standard ZOQL.
avg()
Use avg() to return the average value.
Limitations
The avg() function supports only numeric values.
Example
count()
Use count() to return the number of rows. Similar to standard SQL, you can use the following syntax with count() :
count(*)count(field)
The count() command is the only Export ZOQL command that supports the use of an asterisk ( * ).
Example
max()
Use max() to return the largest value.
min()
Use min() to return the smallest value.
sum()
Use sum() to return the sum.
Limitations
The sum() function supports only numeric values.
Example
Limitations of the Aggregate Functions
The aggregate functions have the same limitations as standard SQL aggregate functions.
In addition to specific limitations, you cannot nest aggregate functions.