Skip to content

Latest commit

 

History

History
74 lines (54 loc) · 1.76 KB

min-of-function.md

File metadata and controls

74 lines (54 loc) · 1.76 KB
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

min_of()

Returns the minimum value of several evaluated scalar expressions.

Syntax

min_of (arg, arg_2, [ arg_3, ... ])

[!INCLUDE syntax-conventions-note]

Parameters

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.

Returns

The minimum value of all argument expressions.

Examples

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)