Add function

Adds a positive or negative decimal to a column or adds multiple columns to output the sum of each row.

Namespaces

  • arithmetic

  • decimal

Input

Numeric values

Output

Numeric values

Applied to one column

Adds a decimal to each value in one column.

Syntax

For non-decimal columns:

set-column :column column + <decimal_value>

For decimal columns:

set-column :column decimal:add(column,<decimal_value>)

Example

Adds 10 to each row in the price column and returns results to the price_new column.

For non-decimal columns:

set-column :price_new price + 10

For decimal columns:

set-column :price_new decimal:add(price, 10)

Applied to two columns

Adds values in two columns.

Syntax

set-column :column arithmetic:add(column1,column2)

Example

Adds values in Q1_sales and Q2_sales columns and outputs results to a new column H1_sales.

set-column :H1_sales arithmetic:add(Q1_sales,Q2_sales)

Created in 2020 by Google Inc.