STEM help / Model structure

9.1.2 Referencing input parameters

Once you have added some new input parameters, you can reference those fields in formulae. To continue the example given in the previous section:

  1. Select Costs from the dialog Move menu. The resource Costs dialog appears.
  2. Select the Maintenance Cost field and press <F2>, or click in the formula bar, to start editing.
  3. 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.
  4. 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:

  1. Click the button on the Costs dialog menu, or press <Alt+T>, in order to access the Costs table.
  2. Select the Maintenance Cost field for the original resource.
  3. Select Copy from the tabular dialog Edit menu, or press <Ctrl+C>.
  4. 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.
  5. 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.
  6. Click the button on the User Data dialog, or press <Alt+T>, in order to access the resource User Data table.
  7. 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.

 

© Implied Logic Limited