min
Returns the minimum value across the group.
Syntax
min(val)Parameters
Prop
Type
Returns: bool
Syntax
min(val)Parameters
Prop
Type
Returns: int
Syntax
min(val)Parameters
Prop
Type
Returns: long
Syntax
min(val)Parameters
Prop
Type
Returns: real
Syntax
min(val)Parameters
Prop
Type
Given a dynamic field
This parameter is string-only. In permissive mode — the default — almost every field arrives as a dynamic, so passing one works because Berserk injects asstring: extract-or-null, the value when it really is a string and null otherwise, so the call yields null (a predicate yields false). A property bag or array is therefore not matched, and tostring() is never applied implicitly — use it explicitly to match a bag's JSON text, keys included. Strict mode rejects the dynamic instead of coercing it. See String coercion and the asXXX family.
Returns: string
Syntax
min(val)Parameters
Prop
Type
Returns: datetime
Syntax
min(val)Parameters
Prop
Type
Returns: timespan
Syntax
min(val)Parameters
Prop
Type
Returns: guid
Syntax
min(val)Parameters
Prop
Type
Returns: dynamic
Examples
Example 1 — Minimum numeric value per group
datatable(clan:string, warrior:string, voyages:long)[
"Lothbrok", "Ragnar", 42,
"Lothbrok", "Bjorn", 31,
"Fairhair", "Harald", 25,
"Fairhair", "Halfdan", 12
]
| summarize min(voyages) by clan| clan (string) | min_voyages (long) |
|---|---|
| Fairhair | 12 |
| Lothbrok | 31 |
Example 2 — Minimum across numeric, string, and datetime columns
datatable(clan:string, warrior:string, voyages:long, joined:datetime)[
"Lothbrok", "Ragnar", 42, datetime(2024-01-15),
"Lothbrok", "Bjorn", 31, datetime(2024-06-01),
"Fairhair", "Harald", 25, datetime(2023-03-20),
"Fairhair", "Halfdan", 12, datetime(2023-09-10)
]
| summarize min(voyages), min(warrior), min(joined) by clan| clan (string) | min_voyages (long) | min_warrior (string) | min_joined (datetime) |
|---|---|---|---|
| Fairhair | 12 | Halfdan | 2023-03-20T00:00:00Z |
| Lothbrok | 31 | Bjorn | 2024-01-15T00:00:00Z |