Subtract¶
Subtracts the remaining values from the first, with date- and float-aware promotion.
Subtracts each subsequent parameter from the first. With no additional parameters, the first value is reduced by all available inputs. Date arithmetic is supported: a single date in the input keeps the output as a date, while two dates produce an integer (their difference in seconds).
Parameters¶
- 1 —
minuendMandatory — accepts: field, INT, FLOAT, DATE -
The value to subtract from. May be a field reference or a static value.
- N —
subtrahendsOptional — accepts: field, INT, FLOAT, DATE -
The Nth value to subtract from the minuend. May be a field reference or a static value.
Input type¶
INTFLOATDATE
Output type¶
matches-input-promotion
Returns FLOAT if any input is a float; DATE if a single date is in
the input; INT if two dates are in the input.
Requires¶
- At most two dates can be given in the input.
- A float cannot be subtracted from a date.
- A date can neither be subtracted from a float nor an integer.
- If a float is in the input the return type will always be a float.
- If a single date is in the input, the return type will be a date.
- If two dates are in the input, the return type will be an integer.
Examples¶
Subtract from all available inputs
Subtract a static value from a field
Date difference in seconds
Multiple subtrahends