Yandex Cloud
  • Services
  • Solutions
  • Why Yandex Cloud
  • Blog
  • Pricing
  • Documentation
  • Contact us
Get started
Language / Region
Yandex project
© 2023 Intertech Services AG
Yandex DataLens
  • Getting started
  • Tutorials
  • Concepts
  • Step-by-step guides
  • Access management
  • Pricing policy
  • Visualization reference
  • Function reference
    • All Functions
    • Aggregate functions
      • Overview
      • ALL_CONCAT
      • ANY
      • ARG_MAX
      • ARG_MIN
      • AVG
      • AVG_IF
      • COUNT
      • COUNTD
      • COUNTD_APPROX
      • COUNTD_IF
      • COUNT_IF
      • MAX
      • MEDIAN
      • MIN
      • QUANTILE
      • QUANTILE_APPROX
      • STDEV
      • STDEVP
      • SUM
      • SUM_IF
      • TOP_CONCAT
      • VAR
      • VARP
    • Array functions
    • Date/Time functions
    • Logical functions
    • Mathematical functions
    • Operators
    • String functions
    • Text markup functions
    • Time series functions
    • Type conversion functions
    • Window functions
    • Function Availability
  • Function tutorials
  • Courses
  • Troubleshooting
    • Questions and answers
    • DataLens errors
  1. Function reference
  2. Aggregate functions
  3. ARG_MAX

ARG_MAX

Written by
Yandex Cloud

Syntax

Standard
Extended
ARG_MAX( value, comp )
ARG_MAX( value, comp
         [ FIXED ... | INCLUDE ... | EXCLUDE ... ]
         [ BEFORE FILTER BY ... ]
       )

More info:

  • FIXED, INCLUDE, EXCLUDE
  • BEFORE FILTER BY

Description

Returns value for the maximum value of comp in the group. If multiple values of value match the maximum value of comp, then the first one encountered is returned. This makes the function non-deterministic.

Argument types:

  • value — Any
  • comp — Any

Return type: Same type as (value)

Example

ARG_MAX([Sales], [Profit])

Data source support

ClickHouse 19.13, YDB.

Was the article helpful?

Language / Region
Yandex project
© 2023 Intertech Services AG