A Calculated group is formed by applying a user-provided formula to the values of the group members.
To create or edit a calculated group:
Show all and Show selected enable you to view either all the available items or only the items you have selected. This can help you visualize your item selections more clearly.
The calculated group appears on the Custom groups page.
Formulas for calculated groups
Note: Formulas for calculated groups have a 255-character limit.
Use the following arithmetic operators:
+ Add
- Subtract
* Multiply
/ Divide
^ Raise to the power of
Use the following relational operators:
< Less than
<= Less than or equal to
= Equal to
> Greater than
>= Greater than or equal to
<> Not equal to
Evaluate from left to right, except for the following exceptions:
Use logical constructs:
If, then, else, and endif constructs can be used to create more complex formulas.
Missing values in calculations
Formula examples
Formula |
Result |
Salary*1.1 |
Salary multiplied by 1.1 |
(Age+20)/2 |
(Age plus 20) divided by 2 |
if Age >40 then Salary*1.05 else Salary*1.15 endif |
If Age is greater than 40, then Salary is multiplied by 1.05; if Age is less than or equal to 40, Salary is multiplied by 1.15 |
if Sex = “1” then 0 |
If Sex = code 1, the value is zero; otherwise Salary is multiplied by 1.1 to arrive at the value. |
if Population > 10000 then Expenditure / Population else {} endif |
If Population is greater than 10000, Expenditure is divided by Population. Otherwise the result is a missing value. |