1.3.5.5 Subtract

The Subtract processor subtracts one numeric value from another. Both numeric values are input from attributes.

Use Subtract to subtract one numeric value from another.

The following table describes the configuration options:

Configuration Description

Inputs

Specify one numeric attribute to subtract from, and one numeric attribute to subtract.

Options

None.

Outputs

Describes any data attribute or flag attribute outputs.

Data Attributes

The following data attributes are output:

  • SubtractedValue: a new Number attribute with the result of the subtraction. Value is the numeric result of the subtraction operation.

    If you attempt to subtract from a Null value, this is treated as different from subtracting from 0 - the result in this case will always be Null. If you want to treat Null values as 0, you should use a Replace processor to replace Null values with 0.

Flags

None.

The Subtract transformer presents no summary statistics on its processing.

In the Data view, the input attributes are shown with the new SubtractedValue to the right.

Output Filters

None.

Example

In this example, a Discount attribute is subtracted from a Retail Price attribute to give the final order total. The new attribute is named SubtractedValue by default, but in this example has been renamed to 'Order Total'.

Retail Price Discount Order Total

211

20

191

189

18.9

170.1

149.99

29.99

120

204.99

18

186.49