Skip to content

Min

aggregating category: aggregation no `||`

Returns the smallest value among the given parameters or inputs, folding ARRAY inputs element-by-element.

Without parameters, Min selects the minimum across all available inputs. When parameters are given, it chooses among those parameters only.

An ARRAY input is folded element-by-element — Min compares array contents, never an array as a whole — so scalars and arrays mix freely in one call (e.g. Min(5, :int_array)), and GetCDMTableId(@idx, :key)[] => Min() yields the minimum of all matched values. The element type drives the comparison; when every input is an ARRAY the output type defers to the destination field.

Parameters

Ncandidates Optional — accepts: field, DATE, FLOAT, INT, STRING

The Nth candidate value. May be a field reference (scalar or ARRAY) or a static value.

Input type

  • DATE
  • FLOAT
  • INT
  • STRING
  • ARRAY

Output type

  • same-as-input

Requires

  • All parameter types and (scalar) input types must be identical; ARRAY element types must match too.

Examples

Min across all inputs

Min()

Two field references

Min(:value1, :value2)

Field reference vs. static value

Min(:value, 42)

Lexicographic min of strings

Min(:text1, :text2, "Alpha")

Minimum of a collected ARRAY

GetCDMTableId(@idx, :key)[] => Min()

See also

Max, Sum, Count, Avg, Selector