ARG_MAX

    Syntax

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

    More info:

    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:

    • valueAny
    • compAny

    Return type: Same type as (value)

    Example

    ARG_MAX([Sales], [Profit])
    

    Data source support

    ClickHouse 19.13.