Skip to main content
Skip to main content

argMax

Calculates the arg value for a maximum val value. If there are multiple rows with equal val being the maximum, which of the associated arg is returned is not deterministic. Both parts the arg and the max behave as aggregate functions, they both skip Null during processing and return not Null values if not Null values are available.

Syntax

Arguments

  • arg — Argument.
  • val — Value.

Returned value

  • arg value that corresponds to maximum val value.

Type: matches arg type.

Example

Input table:

Query:

Result:

Extended example

See also