title | description | ms.reviewer | ms.topic | ms.date |
---|---|---|---|---|
min_of() |
Learn how to use the min_of() function to return the minimum value of all argument expressions. |
alexans |
reference |
01/08/2023 |
Returns the minimum value of several evaluated scalar expressions.
min_of
(
arg,
arg_2,
[ arg_3, ... ])
[!INCLUDE syntax-conventions-note]
Name | Type | Required | Description |
---|---|---|---|
arg, arg_2, ... | scalar | ✔️ | A comma separated list of 2-64 scalar expressions to compare. The function returns the minimum value among these expressions. |
- All arguments must be of the same type.
- Maximum of 64 arguments is supported.
- Non-null values take precedence to null values.
The minimum value of all argument expressions.
Find the maximum value in an array:
[!div class="nextstepaction"] Run the query
print result=min_of(10, 1, -3, 17)
Output
result |
---|
-3 |
Find the minimum value in a data-table. Non-null values take precedence over null values:
[!div class="nextstepaction"] Run the query
datatable (A: int, B: int)
[
5, 2,
10, 1,
int(null), 3,
1, int(null),
int(null), int(null)
]
| project min_of(A, B)
Output
result |
---|
2 |
1 |
3 |
1 |
(null) |