argwhichever

argwhichever(), aggregator

Returns true for one value of the group.

Example:

table Products = with
  [| "Hat" as Label, 15.00 as UnitPrice |]
  [| "Shirt"       , 15.00              |]
  [| "Pants"       , 25.00              |]

Products.IsTrue = argwhichever() by Products.UnitPrice

show table "" a1c3 with
  Products.Label
  Products.UnitPrice
  Products.IsTrue

argwhichever(T.a: boolean), aggregator

Returns true for a value of the group for which the condition is true.

table Products = with
  [| "Hat" as Label, 15.00 as UnitPrice, false as Eligible |]
  [| "Shirt"       , 15.00             , true              |]
  [| "Pants"       , 25.00             , true              |]

Products.IsTrue = argwhichever(Products.Eligible) by Products.UnitPrice

show table "" a1c3 with
  Products.Label
  Products.UnitPrice
  Products.IsTrue