Once you have added some new input parameters, you can reference those fields in formulae. To continue the example given in the previous section:
- Select Costs from the dialog Move menu. The resource Costs dialog appears.
-
Select the Maintenance Cost field and press <F2>, or click in the formula bar, to start editing.
-
Enter a formula for Maintenance Cost either by typing Labour + Parts
or by clicking on the appropriate buttons in the User Data dialog to pick up internal references to the fields.
-
Press <Enter>. The Maintenance Cost is calculated as the sum of the two values you entered for Labour and Parts.
If you subsequently modify the labels for User 1 or User 2, the text in this formula will be updated automatically to reflect any changes. In fact you can always enter the formula as
User 1 + User 2, but it will be re-displayed as Labour + Parts
as soon as you press <Enter>.
Figure 1: Calculating Maintenance Cost from User Data
This model for Maintenance Cost can easily be extended to other resources, allowing you to set up a consistent data model for all elements:
-
Click the
button on the Costs dialog menu, or press <Alt+T>, in order to access the Costs table.
- Select the Maintenance Cost field for the original resource.
- Select Copy from the tabular dialog Edit menu, or press <Ctrl+C>.
-
Left-click in the Maintenance Cost field for the first resource, and drag along the row (or column), or press <Shift+End>, to select the Maintenance Cost fields for all resources.
-
Select Paste Formulae from the tabular dialog Edit menu, or press <Ctrl+V>. The formula
Labour + Parts
is copied into the Maintenance Cost field for all resources.
-
Click the
button on the User Data dialog, or press <Alt+T>, in order to access the resource User Data table.
-
Enter values for Labour and Parts for the other resources. The respective Maintenance Costs in the resource Costs table are calculated automatically.
Figure 2: Copying a formula for Maintenance Cost to all resources
Notice how the references to Labour and Parts
– interpreted as "Resource 1".Labour and
"Resource 1".Parts
in the original formula – are copied in a relative fashion, so that the corresponding references in the formula for Resource 2, while still appearing as
Labour
and Parts, are now interpreted as
"Resource 2".Labour
and "Resource2".Parts respectively – see 4.15.2 Copying and pasting fields.