Using Calculated Fields

  1. Select Calculated Field from the Insert menu. The Edit Field dialog is displayed.
  2. Specify this information:
    Name
    Enter a name for the calculated field. This is used as the field alias and must not already exist in the Field list. An error message is displayed if this name is not unique or is in an invalid format.
    Data Field, Parameter or Special Field
    Select this option and click the browse button to display the Enter Field/Expression dialog containing the Fields, Data Fields, and Special Fields browser panes. Once a field is selected any value in the Expression field is cleared.
    Expression
    Select Expression and click the browse button to open the Value Expression dialog. From the Value Expression dialog, click the browse button and then the Expression tab where you can type a value directly into the Expression box.
    Alternatively, you can click the Fx icon below the Expression box to display the Expression Builder where you can select and then insert fields, parameters, report items, scopes and functions into the expression using the Insert button. The expression can be:
    • a constant
    • a known global value like Today, or Value
    • a parameterized function like DateDiff
    • a pass through expression (for example, the sum of two fields).
  3. Enter a value for the default case statement.
  4. Click Add Case. The value entered is displayed on a tabbed dialog labeled Case 1 to the left of the default case. The default case is always shown to the right of the other cases.
  5. Click the browse button to redisplay the Enter Field/Expression dialog. Enter the options required and click OK.
  6. Select Standard Filter or Custom Expression.
  7. Specify this information:
    Standard Filter
    Select a value for the expression by clicking the browse button for the field. The Enter Field/Expression dialog is re-displayed, allowing you to enter a data field, parameter or special field, or enter a custom expression.
    Select a condition from the drop-down list.
    Select an Expression by entering a value directly or by clicking the browse button for the field. The Edit Field dialog is re-displayed, allowing you to enter a data field, parameter or special field, or enter a custom expression.
    You can lookup the value using the same lookups as are defined in parameter entry and return these to the field. The values returned in the lookup depend on the data type of the parameter or the field selected on the left side of the condition. You can add any number of conditions.
    Custom Expression
    You can copy the set of conditions for a particular case to use as the basis of a custom expression.
    Once copied from a standard expression you can use the undo feature to redress the situation but cannot copy expressions back to the standard after they have been amended.
    You can add more cases as required. You can change the priority of cases by selecting a case and using the arrows. Any case or condition can be deleted.
  8. Save your changes.