The Formula Editor dialog aids in creating and editing formulas for auto-calculated values. The Formula Editor is divided into 3 parts: available syntax and properties list (left), Condition (top right), and Formula (bottom right).
When the Condition (optional) and Formula are defined, press OK to save the formula and exit the Formula Editor. The Condition will be placed in brackets [] before the Formula in the Navigator>User Fields>Formula text box - [Condition]Formula. Pressing Cancel will exit the Formula Editor without saving changes.
Syntax
The available list of syntax and properties is divided by categories. Expand a category and select the desired command or property. A short description of the selected syntax is shown at the bottom of the dialog. To add the command or property to the Condition or Formula, double click on it, or press the Insert button. It will be added where the cursor is. The available syntax is described here
Condition
The Condition must be a expression that yields a single TRUE or FALSE value when evaluated. This condition is calculated for each object (in accordance with the settings in Options->General->User Field Recalculation). If the condition is not TRUE, then the Formula is not calculated and the User Field Value is not created or updated when Recalculate User Field Values is run
Examples of Conditions:
Condition |
Description |
NAME == "XXX" OR NAME == "YYY" |
True if the Object Name is either XXX or YYY |
SELECTED AND NUM_CHILDREN == 0 |
True if the Object is both selected and has no child objects (ie. bottom level of the object tree) |
UFV("UFName") == "ZZZ" |
True if the value of the String type User Field "UFName" is ZZZ |
UFV("UFNumber") > 10 |
True if the value of the Number or Integer type User Field "UFNumber" is greater than 10 |
Formula
The Formula must be an expression that results in a single value of the appropriate type (String, Integer, Number, Boolean, Date) when calculated. When Recalculate User Field Values is run, the Formula is calculated for each object for which the Condition is TRUE (in accordance with the settings in Options->General->User Field Recalculation).
Examples of Formulas:
User Field Category |
User Field Type |
Formula |
Description |
Task |
Number |
SUM (RESOURCE.UFV("Dimensions.Volume")) |
Sums the value of Volume UF of all resources assigned to task (eg. Steel Volume) |
Resource |
String |
UFV(“Level”) + ”-“ + UFV(“Zone”) + ”-“ + UFV(“Piecemark”) |
Concatenates the Level, Zone, and object piecemark with dashes between them into a single string |
Task |
Boolean |
PROPERTY("Actual Start") > PROPERTY("Planned Start") |
Indicates if a task’s actual start is later than planned |
Related Topics: