Add Report Variables

Before you can use variables in report output columns, filters, or data exceptions, the variables first need to be created.

There are several types of variables you can use, including predefined lists, user-defined lists, ad hoc values, and replacement values. Each of these serves a unique function.
  1. Click the Home tab.
  2. Click Add Variable.
    The Add Variable window opens.
  3. Enter a name for the variable in the Name field.
    Variable names are always preceded by the dollar sign.
    The options on the Add Variable window change depending on the variable type that's selected.
  4. Enter an optional prompt in the Prompt field.
    The Prompt field isn't available when using a Replacement Value variable type, as this type doesn'tt display when running a report
    This text displays on the Search window when running the report. If this field is left empty, the variable’s name displays instead.
  5. Select the variable type from the Type drop-down list.

    Variable Types

    Field Description
    Predefined List variables Select this type to use values from an existing menu or predefined list in the variable. When selecting this option, all menu fields from the tables used in the report are available, along with three predefined lists.
    • Group Date—This list contains date/time formats, such as Month, Week, and Day of Month.
    • Yes/No—This list contains Yes and No options.
    • Currency Formats—This list contains currency formats, such as USD and CAN, that are defined on your site.

    User Defined List

    Select this type to compile your own list of menu items to use for the variable. For example, if you wanted the variable to return either incidents’ statuses or assigned staff accounts, you could create a variable value for incidents.status and another for incidents.assgn_acct_id.

    When you select this type, you must select a data type for the variable. See step 7 in this procedure for a description of the available data types.

    Ad Hoc Value

    Select this type to allow staff members to enter their own value for the parameter at runtime, without having to select from a list. For example, an individual using the report types the exact expression or string to use as the variable value.

    When you select this type, you must select a data type for the variable. See step 7 in this procedure for a description of the available data types.

    Replacement Value Select this type to enter an expression that you want to use in several places in the report. The replacement value variable you create can be added to the report in any place you would otherwise need to enter the expression. This lets you use a short variable name rather than a lengthy expression.
  6. If using a predefined list variable type, select the list to use from the List Name drop-down list.
  7. If using a user-defined list or ad hoc value variable type, select the data type to use from the Data Type drop-down list.

    Variable Data Types

    Data Type Description

    String

    Select this option to add a variable that uses a string field.

    Integer

    Select this option to add a variable that uses an integer field.

    Float

    Select this option to add a variable that uses a numeric field that can contain decimal points.

    Date and Time

    Select this option to add a variable that uses a date and time field.

    Currency

    Select this option to add a variable that uses a currency field.

    Expression

    Select this option to add a variable that uses a database field (for example, incidents.status).

    This data type isn't available for ad hoc values.

  8. If using a user-defined list variable type, create the list items you want to include.
    1. Click Add Item. The Edit Variable List Item window opens.
    2. Enter a name for the list item in the Name field.
    3. Enter a value for the list item in the Value field.
      The format of the Value field changes depending on the data type selected for the user-defined list. For example, the Value field for a Date and Time list item displays a calendar, whereas the Value field for an expression list item displays a text box and includes an Advanced option you can click to open the data dictionary to help you build the expression.
    4. Click OK.
    5. Add the other list items you want to be able to select for the variable.
  9. If using a predefined list or user-defined list variable type, enter a default value for the variable in the Default field.
  10. If using an ad hoc value variable type, enter a default value for the variable in the Default field.
  11. Do one of the following:
    • If using a replacement variable type, enter the expression you want the variable to replace.
    • Click Use Data Dictionary to open the data dictionary to create the expression from database fields and functions.
  12. Click OK.