MIN

MIN returns the minimum value in a numeric dataset. It can also take an arbitrary number of additional arguments.

Function category: Statistical

Syntax

MIN(arg1, [arg2...])

Arguments

Description

arg1

Number, string or an array of numbers or strings (or anything that can be coerced into being a number)

arg2

Optional. Has the same restrictions as arg1.

Examples

Let's say we're given a response with the following vehicle information:

{
"data":{
"local_service_prices":{
"highest_rated":160,
"nearest":120,
"regional":[
140,
90,
115,
220
]
}
}
}

Example 1: Find the smaller of the nearest and highest rated items

If we want to find the smaller of the nearest and highest rated service stations, use the following function.

# Find a specific value in an array
MIN(data.local_service_prices.highest_rated, data.local_service_prices.nearest)
# Returns 120

Example 2: Using an array as an argument

We can also use arrays as arguments using the following function.

# Using arrays as argument
MIN(data.local_service_prices.highest_rated, data.local_service_prices.nearest, data.local_service_prices.regional)
# Returns 90