CollectionsCollections Database

Sum or substract values in a document

To sum values in a document, open a collection and tap on button → Select Fields.

You should create two decimal number fields such as Amount 1 and Amount 2.

Sum values

Tap on Edit.

Sum values

Add a Formula field with the button.

Sum values

Select Decimal number.

Sum values

Tap on Done.

Sum values

Open the newly created field.

Sum values

Assign a name such as Sum and tap on Edit formula.

Sum values

The formula is empty. Tap on the button to add an expression.

Sum values

Scroll down and select the Sum function.

Sum values

Tap on the button again.

Sum values

Select Amount 1 (or another field) from the list.

Sum values

Tap on button and repeat the previous step selecting Amount 2 (or another field).

Sum values

The formula is completed, tap on Save to confirm.

Subctract values

To subctract values (difference between values) you can use use the Minus function. The Minus function prepends a minus in front of a number.

Subctract values

The example shows how to use the Minus function.