Basic aggregation functions are a group of the most common aggregation functions.
Use the drop-down on each function to see a brief description and the syntax of each function. Click the function name in the syntax description for further details.
Basic aggregation functions in the data load script
FirstSortedValue() returns the value from the expression specified in value that corresponds to the result of sorting the sort_weight argument, for example, the name of the product with the lowest unit price. The nth value in the sort order, can be specified in rank. If more than one resulting value shares the same sort_weight for the specified rank, the function returns NULL. The sorted values are iterated over
a number of records, as defined by a group by clause, or aggregated across the full data set if no group by clause is defined.
Max() finds the highest numeric value of the aggregated data in the expression, as defined by a group
by clause. By specifying a rank n, the nth highest value can be found.
Min() returns the lowest numeric value of the aggregated data in the expression, as defined by a group
by clause. By specifying a rank n, the nth lowest value can be found.
Mode() returns the most commonly-occurring value, the mode value, of the aggregated data in the expression, as defined by a group by clause. The
Mode() function can return numeric values
as well as text values.
Only() returns a value if there is one and only one possible result from the aggregated data. If records contain only one value then that value is returned, otherwise NULL is returned. Use the group by clause to evaluate over multiple records. The Only() function can return numeric and text values.
Chart aggregation functions can only be used on fields in chart expressions. The argument expression of one aggregation function must not contain another aggregation function.
FirstSortedValue() returns the value from the expression specified in value that corresponds to the result of sorting the sort_weight argument, for example, the name of the product with the lowest unit price. The nth value in the sort order, can be specified in rank. If more than one resulting value shares the same sort_weight for the specified rank, the function returns NULL.
Mode() finds the most commonly-occurring value, the mode value, in the aggregated data. The Mode() function
can process text values as well as numeric values.
Only() returns a value if there is one and only one possible result from the aggregated data. For example, searching for the only product where the unit price =9 will return NULL if more than one product has a unit price of 9.