MIN
- MIN(*values)[source]
Returns the minimum value among the provided inputs.
This function evaluates the given inputs, which can be numeric literals, fields, formulas, calculations, or parameters, and returns the smallest value. It supports scalar and array-compatible numeric, date, time, and datetime types.
- Parameters:
*values (
Operand|int|float) – An arbitrary number of values or fields to compare. All inputs must be of compatible types (numeric, date, time, or datetime).- Return type:
- Returns:
The minimum value among the inputs.
- Raises:
ValueError – If no inputs are provided.
ValueError – If any input is of an unsupported type.
ValueError – If inputs are of incompatible types.
Examples
Minimum of numeric literals:
MIN(3, 7, 1, 9) # Returns 1
Minimum of multiple table columns:
MIN(order_table["quantity"], order_table["min_quantity"]) # Returns the smallest value between both columns
Minimum of date values:
MIN(DATE(2025, 1, 1), DATE(2024, 12, 31)) # Returns DATE(2024, 12, 31)
Note
This formula only returns a scalar value. For array-wise minimums, use the ARRAYMIN formula instead.
``value`` (variadic) — accepted types
DATE
DATETIME
DATETIME_ARRAY
DATE_ARRAY
DECIMAL
DECIMAL_ARRAY
INTEGER
INTEGER_ARRAY
TIME
TIME_ARRAY
Return types
DATE
DATETIME
DECIMAL
INTEGER
TIME