single

There are other concepts named single. See the entire list.

single, table modifier

The single modifier on a by table creation enforces one row per group and copies vectors from the source table into the grouped table.

Example

table T = with
  [| as Code, as X |]
  [| "FR", 1 |]
  [| "US", 2 |]
  [| "UK", 3 |]

table Countries[c] = single by T.Code

show table "Countries" with
  c
  Countries.X

This outputs the following table:

c X
FR 1
UK 3
US 2

Errors

Fails if any group contains more than one element.

User Contributed Notes
0 notes + add a note