Skip to content

MaxBy

Description

MaxBy returns the value associated with the maximum value of a sort expression.

Syntax

MaxBy(value, sort_expression)

Parameters

Parameter Required Type Description
value Yes Field or expression Value to return.
sort_expression Yes Field or expression Expression used to find the maximum row.

Notes

Aggregate functions are commonly used in metric definitions and grouped query results.

Example

MaxBy(ProductName, SalesAmount)

The expression returns the calculated result according to the current query context.