Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
In this article
Applies to: ✅ Azure Data Explorer ✅ Azure Monitor ✅ Microsoft Sentinel
Returns the maximum value of all argument expressions.
max_of(
arg,
arg_2,
[ arg_3,
... ])
Learn more about syntax conventions.
Name | Type | Required | Description |
---|---|---|---|
arg_i | scalar | ✔️ | The values to compare. |
- All arguments must be of the same type.
- Maximum of 64 arguments is supported.
- Non-null values take precedence to null values.
The maximum value of all argument expressions.
This query returns the maximum value of the numbers in the string.
print result = max_of(10, 1, -3, 17)
Output
result |
---|
17 |
This query returns the highest value from columns A and B. Notice that non-null values take precedence over null values.
datatable (A: int, B: int)
[
1, 6,
8, 1,
int(null), 2,
1, int(null),
int(null), int(null)
]
| project max_of(A, B)
Output
result |
---|
6 |
8 |
2 |
1 |
(null) |
This query returns the later of the two datetime values from columns A and B.
datatable (A: datetime, B: datetime)
[
datetime(2024-12-15 07:15:22), datetime(2024-12-15 07:15:24),
datetime(2024-12-15 08:00:00), datetime(2024-12-15 09:30:00),
datetime(2024-12-15 10:45:00), datetime(2024-12-14 10:45:00)
]
| project maxDate = max_of(A, B)
Output
maxDate |
---|
2024-12-15 07:15:24 |
2024-12-15 09:30:00 |
2024-12-15 10:45:00 |