# SUM Function

From Planfix

**SUM()** — is a function that sums all values when calculating a formula. It is applied to each element of the multiplying variable.

## Format

- SUM(expression)

Arguments:

**Expression** - a mandatory parameter, a variable, or a formula with the final sum of several strings.

## Example

For example, you have a data tag "Service", and you want to calculate the total cost of all services. To do this, specify the function:

SUM({{Data Tag.Service.Cost}})

To get the total cost of services that may be provided more than once, you must multiply the cost by the quantity and then add it all up. At the end, you specify a formula like this:

SUM({{Data Tag.Service.Cost}}*{{Data Tag.Service.Amount}})

## Important

- The function SUM () can contain any formula that consists of functions.