ARRAYMIN

ARRAYMIN(*values)[source]

Returns the minimum value(s) across one or more numeric inputs or arrays.

ARRAYMIN performs either a scalar minimum operation or an element-wise minimum operation depending on the input types:

  • Scalar operation: If all inputs are single values, returns the smallest value.

  • Element-wise array operation: If any input is an array, performs a position-wise minimum across all inputs, broadcasting scalar values to match array lengths.

Parameters:

*values (Operand | int | float) –

One or more numeric values or arrays to compare. Each value must be one of the supported types. Mixed inputs (scalars and arrays) are allowed.

Supported types:

  • INTEGER

  • DECIMAL

  • INTEGER_ARRAY

  • DECIMAL_ARRAY

Return type:

Formula

Returns:

A formula object representing the minimum scalar if all inputs are scalar values, an array of element-wise minimums if any input is an array. The return type is DECIMAL if any decimal input is present; otherwise INTEGER. Array outputs match the length of input arrays. All arrays must have equal length else an error value is returned.

Supported types:

  • INTEGER

  • DECIMAL

  • INTEGER_ARRAY

  • DECIMAL_ARRAY

Raises:
  • ValueError – If no input is provided.

  • ValueError – If any input is not a supported numeric type.

Examples

Basic scalar usage:

ARRAYMIN(1, 5, 3)
# Returns 1

Element-wise array comparison:

ARRAYMIN(
    [1, 2, 3],
    [4, 1, 2]
)
# Returns [1, 1, 2]

Mixed scalar and array:

ARRAYMIN(
    5,
    [2, 7, 4]
)
# Returns [2, 5, 4]