In a formula-type column, the SUM() function adds the contents of multiple columns together.
-
Numeric function name:
SUM()
Syntax
SUM(column_1, column_2, ...)
Calling function parameters in TimeTonic:
- $field_name = field (link, linked table column, number, selection, formula, text...).
- "free text" = free text to add within quotes.
- do not use quotes for numbers.
Parameters
| Parameter | Description |
|---|---|
column_1, column_2, ... |
Number-type columns and/or numeric values to add together. |
Example 1
SUM($Amount excl. tax, $VAT)
I added the Amount excl. tax column with the VAT column.
Example 2
SUM($Amount excl. tax, $VAT, 12.90)
In addition to example 1, I added 12.90 which could correspond, for example, to fixed fees.
Following the same logic, you can subtract an amount by adding a negative number:
SUM($Amount excl. tax, $VAT, -10)
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
SUM() calculates a total row by row: total including tax (excl. tax + VAT), order total with fees, sum of multiple cost items.
Best practice
To add values from a column of a linked table (multiple items), use SUM_ELEMENTS() instead.