On this page

Calculation rules are the entry point for every calculation within sumUp.

They define which values should be calculated in which way (sum, average) and how they should be displayed.

Why do I need calculation rules?

Calculation rules are used within sumUp to tell the app which values should be calculated. In addition, you can set the calculation method and several formatting options.

Create a new rule

To create a new calculation rule head over to Manage apps → sumUp calculation rules:

Hit the "Add new rule" button in the upper right corner to open the following pop-up menu:


Configuration options

Mode

The field values can either be

  • summed up to calculate a total or
  • the average can be calculated.
Rule name

Enter a custom name for the rule.

If nothing is set, the field name will be used as rule name.

In addition, icons for the summation or average can be used in the name for easier identifaction.

Output format

The output can be formatted using a custom velocity template.

See here how it works!

Decimal places

Select the number of decimal places to be displayed.

The values will then be rounded accordingly.

Prefix & suffix

Set a custom prefix or suffix to give the user a hint what you are calculating there.

Ignore index

sumUp will by default, takes the field values to be calculated from the Lucene index.

When the checkbox is clicked, the field's value will be calculated at runtime instead.

Activating this setting is useful for scripted or other dynamic fields since the index might contain outdated values at this point. Activating this option will guarantee to always retrieve correct values for those fields.

 However, checking this option may cause performance issues because the values have to be re-calculated each time and won't get grabbed from the index.

Input format

When e.g. trying to calculate values from a text field that also contains other data, you can use another Input format to specify, how the field value should be processed by sumUp.

When Default is selected, sumUp will just take the field value and tries to calculate it.

When Regular Expression is selected, you can enter a custom regular expression to specify how the field value should be processed:

Field valueRegular ExpressionEvaluated data
Words: 79
\d+
79
1000 $
\d+(\.\d+)?
1000
The average speed was -1.79e5 m/h.
[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?
-179000

When Local number format is selected, you can specify a locale format in which the value should be processed:

Field valueLocaleEvaluated data
1.000,5de1000.5
1,000.5en1000.5
Primary

It is possible to create more than just one rule per field.

By hitting the Primary checkbox the current rule will be used for the calculation. The other rule will then be disabled but not deleted. This way it can be switched between several different rules.

Setting a rule as primary rule is a global setting for sumUp. After changing the primary rule, this rule will be used everywhere in sumUp (like Gagdets, sum rows or sumUp custom fields).



If you still have questions, feel free to refer to our support team.