Tabular OperatorsProject Operators Adds computed columns to the input table while keeping all existing columns.
extend column = expression, ...
Add computed columns
| Name | Description |
|---|
| column | Name for the new column |
| expression | Expression to compute the column value |
datatable(ship:string, length_m:real, oars:long)[
"Gokstad", 23.2, 32,
"Oseberg", 21.5, 30,
"Skuldelev 2", 30.0, 60
]
| extend crew_estimate = oars * 2, speed_knots = length_m / 3.0
| ship (string) | length_m (real) | oars (long) | crew_estimate (long) | speed_knots (real) |
|---|
| Gokstad | 23.2 | 32 | 64 | 7.733333333333333 |
| Oseberg | 21.5 | 30 | 60 | 7.166666666666667 |
| Skuldelev 2 | 30.0 | 60 | 120 | 10.0 |
datatable(warrior:string, voyages:long)[
"Ragnar", 42,
"Bjorn", 31,
"Ivar", 35
]
| extend rank = iff(voyages > 35, "jarl", "karl")
| warrior (string) | voyages (long) | rank (string) |
|---|
| Bjorn | 31 | karl |
| Ivar | 35 | karl |
| Ragnar | 42 | jarl |
datatable(raid:string, silver:long, gold:long)[
"Lindisfarne", 500, 50,
"Paris", 7000, 800,
"York", 1200, 100
]
| extend total_loot = silver + gold * 10
| raid (string) | silver (long) | gold (long) | total_loot (long) |
|---|
| Lindisfarne | 500 | 50 | 1000 |
| Paris | 7000 | 800 | 15000 |
| York | 1200 | 100 | 2200 |