Skip to main content
Version: v1.12.0

max

Aggregate Function

max maximum value of input values

Synopsis

max(number) -> number

Description

The max aggregate function computes the maximum value of its input.

Examples

Maximum value of simple sequence:

echo '1 2 3 4' | zq -z 'max(this)' -

=>

4

Continuous maximum of simple sequence:

echo '1 2 3 4' | zq -z 'yield max(this)' -

=>

1
2
3
4

Unrecognized types are ignored:

echo '1 2 3 4 "foo"' | zq -z 'max(this)' -

=>

4