max
Returns the maximum value in a column.
Examples
Find the maximum number sold.
max(Sales_Acme.Sales.AMOUNT_SOLD)
Find the maximum number sold, categorized by city.
max(Sales_Acme.Sales.AMOUNT_SOLD, groupBy(Sales_Acme.Sales.CITY))
Syntax
max(double expr, [groupBy(...)]))
- expr : expression returning
double
-
groupBy
: optional grouping functionReturns
double
or as manydouble
s as there are groups ifgroupBy
is used.
Notes
You must include all the leading grouping dimensions in the Insight from the top-down to the level-based measure you want to evaluate. See Aggregation with Level Based Measure in Aggregating Functions.