Returns the value associated with the minimum key. If multiple rows share the minimum key, one is chosen arbitrarily.
key: the numeric key used for ordering.
value: the value returned from the row with the minimum key.
Examples
table T = with
[| as Product, as Price, as Weight |]
[| "Widget A", 100, 2.5 |]
[| "Widget B", 150, 1.8 |]
[| "Widget C", 75, 3.2 |]
show summary "Product analysis" with
argmin(T.Price, T.Product) as "Cheapest"
argmin(T.Weight, T.Product) as "Lightest"
Output:
Cheapest
Lightest
Widget C
Widget B
Remarks
When multiple rows share the same minimum key, the returned value is arbitrary. Reordering rows can change the result in tie cases.