Built-in Functions → average
average() is an aggregation function that returns the average of the values in a column.
average(double expr, [groupBy(...)])
- expr : expression evaluating to
groupBy: optional grouping function that specifies which group of data to operate over
If you use the
groupBy function, you must include all the leading grouping dimensions in the Insight from the top-down to the level-based measure you want to evaluate. For more information, refer to Aggregation with a Level Based Measure.
double representing the average of the values in the column. If
groupBy is used,
average returns the average for each group.
- Compute the average of the values in the data column AMOUNT_SOLD.
- Compute the average of AMOUNT_SOLD by QUARTER_NUMBER.