Creating A Calculated Variable

Use the Calculated User Variable Properties dialog box to add or save a calculated user variable. You can create a new calculated variable or save an existing formula as a calculated variable.

A calculated variable is evaluated as each source row is processed. The result is then passed to the source query or to other formulas used in the job that reference the variable name. This saves processing time compared with having the same formula evaluated multiple times.

To Add A Calculated User Variable

  1. Do one of the following in Workbench to open the Calculated User Variable Properties dialog box:
  2. Enter in Variable Name a meaningful name for the variable.
  3. Select from Data Type the variable type. The available data types are: Date, DateTime, Number, String, and Time.
  4. Enter the value or formula for this variable into the Value/Formula pane or click Formula Editor to use the Edit Formula dialog box.
  5. Optionally, enter in Help Text information about the variable.
  6. Click OK to save. If any required information is missing or if any invalid values were provided, a message appears. Otherwise, the new variable appears under User Variables in the Variables dialog box.

Saving a Calculated Variable

From the Target pane:

  1. Right-click a linked field and select Edit Lookup Criteria. The Edit Lookup Criteria for the selected field appears.
  2. Click Edit Lookup Formula. The Edit Formula for the selected field appears.
  3. Click Save Calculated Variable.

    Insight copies the contents of the formula editing pane into the Value/Formula pane of the Calculated User Variable Properties dialog box.

    You can make changes to the contents of this pane. Note that the Formula Editor is not available.