Subtract function

Subtracts a positive or negative decimal to each value in the column.

Namespace

  • arithmetic

  • decimal

Input

Numeric values

Output

Numeric values

Applied to one column

Subtracts a decimal value from each row in a column.

Syntax

set-column :output_column column - <decimal_value>

Examples

Subtracts 10 to each row in the price column and returns results to the price_new column:

set-column :price_new price - 10

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

Applied to 2 columns

Subtracts values in one column from another column. 

Syntax

set-column :output_column arithmetic:subtract(column1, column2)

Example

Subtracts values in cost_price from selling_price and outputs results to a new column profit.

set-column :profit arithmetic:subtract(selling_price, cost_price)

Created in 2020 by Google Inc.