In a formula-type column, the SUBSTRACT() function subtracts the contents of multiple columns from one another.
-
Numeric function name:
SUBSTRACT()
Syntax
SUBSTRACT(column_1, column_2)
Calling function parameters in TimeTonic:
- $field_name = field (link, related table column, number, selection, formula, text...).
- "free text" = free text to add within quotation marks.
- do not use quotation marks for numbers.
Parameters
| Parameter | Description |
|---|---|
column_1 |
The starting value. |
column_2 |
The value to subtract from the first. |
Example
SUBSTRACT($Amount excl. tax, $Credit)
I subtracted the credit column from the Amount excl. tax column.
Return type
The function returns a number.
The output type format of the result can be configured in the output field options of the formula editor. For more details, see Output format options in the Formula Column article.
Business use cases
SUBSTRACT() calculates a balance or net amount: amount after discount, margin (price minus cost), remaining amount to pay.
Best practice
The order of columns matters: the second is subtracted from the first. To add, use SUM().