MAX_BY

The value correlating to the maximum sort in the time window.

‌Syntax

MAX_BY(VALUE, SORT)

Arguments

VALUE: An expression of any type. SORT: An integer type that can be ordered. ‌

Returns

The result type matches the VALUE type. If the maximum value is not unique, the first VALUE in the set will be returned.

Example

Data

[
   {
      "user":"A01",
      "level":1,
      "score":25
   },
   {
      "user":"A01",
      "level":2,
      "score":48
   },
   {
      "user":"A01",
      "level":2,
      "score":81
   },
   {
      "user":"B02",
      "level":1,
      "score":23
   },
   {
      "user":"B02",
      "level":1,
      "score":29
   }
]

Query

Results

MAX() MAX_EACH() MAX_TIME_SERIES MIN MIN_BY

Dialog

Last updated

Was this helpful?