argwhichever
argwhichever, function
def nosort process argwhichever(): boolean
def process argwhichever(b: boolean): boolean
Returns true for one selected row within each group. With no arguments, the selection is arbitrary. With b, it selects one row where b is true.
b: the boolean condition used to constrain selection.
Examples
table Products = with
[| as Label, as UnitPrice, as Eligible |]
[| "Hat", 15.00, false |]
[| "Shirt", 15.00, true |]
[| "Pants", 25.00, true |]
Products.IsSelected = argwhichever(Products.Eligible) by Products.UnitPrice
show table "Selection" with
Products.Label
Products.UnitPrice
Products.Eligible
Products.IsSelected
Output:
| Label | UnitPrice | Eligible | IsSelected |
|---|---|---|---|
| Hat | 15 | false | false |
| Shirt | 15 | true | true |
| Pants | 25 | true | true |
Remarks
When multiple rows satisfy the selection criteria within a group, the chosen row is arbitrary and can change if the input order changes.