A calculated property is a dynamic value based on other property values within the same element. The value of a calculated property is determined by using a configured formula.
Formula syntax
The following syntax can be used to create the formula:
| Syntax | Description | Example |
|---|---|---|
| + | Addition | 2 + 4 |
| – | Subtraction | 6 – 1 |
| * | Multiplication | 2.1 * 3 |
| / | Division | 6 / 3 |
| ( ) | Parentheses | (4 + 5) / 3 |
Fixed values in a formula
Fixed values can be used for calculations in a formula. The value can be positive or negative, containing a dot as a decimal separator.
Example to convert Celsius to Fahrenheit:
({degrees Celsius (°C)} × 1.8) + 32
Number properties in a formula
To use a number property in the formula, the property name should be placed between curly braces ( {property name} ).
Example to calculate the surface:
({Length} * {Width})
Note:
- A number property configured as calculated is not allowed in a formula.
- The formula value is empty until all properties in the formula have a value.
Option properties in a formula
The option property has a feature dedicated to formulas. A numeric value can be linked to the list property items.
To use the option property in the formula, the property name and attribute name, separated by a hash ( # ), should be enclosed within curly braces ( {property name#attribute name} ).
Example to calculate a risk score:
({Chance#Factor} * ({Impact - Money#Term} + {Impact - Time#Term}))
Note:
- An option property needs to have an attribute before it can be used in a formula.
- The formula value is empty until all properties in the formula have a value.
Properties from a single relation in a formula
Properties of another element can be used in a calculated property of another element.
To use a relation in the formula, the relation name and element name are separated by a colon (:). Add the property as described in Fixed values in a formula or Number properties in a formula. The whole formula should be enclosed within curly braces ({Relation Role: Element name/property name#attribute name}).
Example to calculate a risk score with relations:
({has score: Chance/Value#Factor} * ({Impact - Money#Term} + {Impact - Time#Term}))
Note:
- The formula value is empty until all properties in the formula have a value.
- This feature works:
- If the element with the calculated property has a single outgoing relation to a type element.
- If the element with the calculated property has an incoming relation from a derived element.