Max

max

The max function is a scalar function, which returns the maximum of its arguments. For the opposite, see min.

Spec

max(arg0, arg1, ...)

Parameters

arg0 - Primitive type capable of comparison.
arg1 - Primitive type (same as arg0)
...  - Same types as arg0 and arg1

Return Value

Maximum of all arguments. Same type as arg0.

⚠️ The type of each argument must be the same. If not, this function will fail with a parse error.

Example

range example from 1 to 5 step 1
| project max(example, 3)
max_example_const_int
3
3
3
4
5

Aggregate usage

Inside summarize, max is an alias for agg_max and returns the maximum value per group.

requests
| summarize maxLatency = max(durationMs) by service