Built-in Functions → median
median() is an aggregation function that returns the median of all the values in a column.
median(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 median of the values in the column. If
groupBy is used,
median returns the median for each group.
- Compute the median of the values in the data column AMOUNT_SOLD.
- Compute the median of AMOUNT_SOLD by QUARTER_NUMBER.