The NARY_MIN function returns the minimum value of the input arguments.
NARY_MIN is similar to MIN, except it allows you to compare multiple values.
In this article:Syntax
NARY_MIN(X, Y, [,Z]*)
Output type
By default, NARY_MIN returns an unaggregated dimension.
Examples
Example 1
This example shows how you can mix fields, calculations, and literals in an NARY function:
NARY_MIN(REVENUE, (COST * 2), 10, SESSIONS))
Example 2
Suppose you want to determine the minimum sales for your 3 sales regions by date and your data looks like this:
Date | Region 1 Sales | Region 2 Sales | Region 3 Sales |
Apr 17, 2018 | 100 | 200 | 150 |
Apr 18, 2018 | 75 | 130 | 150 |
Apr 19, 2018 | 225 | 185 | 230 |
You could use the NARY_MIN function to determine the minimum sales for a given date:
NARY_MIN(Region 1 Sales, Region 2 Sales,Region 3 Sales,)
Date | NARY_MIN calculated field |
Apr 17, 2018 | 100 |
Apr 18, 2018 | 75 |
Apr 19, 2018 | 185 |
Notes
NARY_MIN requires at least 2 arguments.
At least one argument must be a field or an expression containing a field.
All arguments must be of the same semantic type, i.e., all numbers. For example you can't perform an NARY function on a number, a text field, and a date.