Extend

extend

Adds one or more computed columns to the input while keeping all existing columns.

Spec

... | extend <column_name> = <expression> [, ...]

Parameters

column_name - The name of the new column to add.
expression  - An expression evaluated for each row.

Return Value

The input table with the additional computed columns appended.

Example

datatable(Name:string, Price:float64)
[
    "Widget", 9.99,
    "Gadget", 24.99
]
| extend Tax = Price * 0.1
| extend Total = Price + Tax
NamePriceTaxTotal
Widget9.990.99910.989
Gadget24.992.49927.489