Skip to main content

Column.-

-other

Group: Operators
Aliases: minus, subtract

Documentation

Element-wise subtraction. Allows to subtract numeric types or compute a difference between two date/time values.

Returns a column with results of subtracting other from each element of self.

Arguments

  • other: The value to subtract from self. If other is a column, the subtraction is performed pairwise between corresponding elements of self and other.

Examples

Subtract one column from another.

      import Standard.Examples

example_minus = Examples.decimal_column - Examples.integer_column

Subtract a single value from each item in a column.

      import Standard.Examples

example_minus = Examples.integer_column - 10

Remarks

Arithmetic Overflow

For integer columns, the operation may yield results that will not fit into the range supported by the column. In such case, the in-memory backend will replace such results with Nothing and report a Arithmetic_Overflow warning. The behaviour in Database backends is not specified and will depend on the particular database - it may cause a hard error, the value may be truncated or wrap-around etc.