in

(T.a : ‘a in U.a : ‘a) 🡒 T.b : boolean, operator

The reserved keyword in is a binary operator returning true if the value found on the left vector exists anywhere in the right vector, and false otherwise. When used inside a where statement with a dimension of the right, the left table acquires a natural join affinity with the dimension.

Example:

table Products[product] = with
  [| as Product, as Price |]
  [| "apple",  1.25 |]
  [| "banana", 0.75 |]

table Orders = with
  [| as Pid, as OrderDate, as Quantity |]
  [| "apple",  date(2020, 8, 15), 3 |]
  [| "apple",  date(2020, 8, 16), 7 |]
  [| "orange", date(2020, 8, 16), 2 |]

where Orders.Pid in product
  Orders.Amount = Products.Price * Orders.Quantity
  show table "Orders" a1c3 with
    product
    Orders.OrderDate
    Orders.Amount