max_of()

Returns the maximum value of all argument expressions.

Syntax

max_of(arg, arg_2, [ arg_3, ... ])

Learn more about syntax conventions.

Parameters

Name Type Required Description
arg_i scalar ✔️ The values to compare.
  • All arguments must be of the same type.
  • Maximum of 64 arguments is supported.
  • Non-null values take precedence to null values.

Returns

The maximum value of all argument expressions.

Examples

Find the largest number

print result = max_of(10, 1, -3, 17) 

Output

result
17

Find the maximum value in a data-table

Notice that non-null values take precedence over null values.

datatable (A: int, B: int)
[
    1, 6,
    8, 1,
    int(null), 2,
    1, int(null),
    int(null), int(null)
]
| project max_of(A, B)

Output

result
6
8
2
1
(null)