Cabletron SPECTRUM Appendix 3: SPECTRUM Specific Tips for Reporting

Table Of ContentsIT Service Vision Help

Using One or More Formula Variables

Formula variables are variables whose values are calculated (from the values of other variables) when you access the data. The values of the formula variables do not occupy disk space in the PDB.

You can add formula variables to PDB tables by using the IT Service Vision server's interactive interface or by using the IT Service Vision %CPDDUTL macro. It is generally preferable to use the %CPDDUTL macro for your production PDB because the macro documents what you did exactly and enables you to add the variables to many tables easily and accurately.

For information on adding a formula variable using %CPDDUTL, see the Macro Reference documentation for IT Service Vision.

Note: The appropriate table to add the formula variable to is the table that contains the variables on which the formula variable is based. In addition to making the Kept status of the formula variable Yes, remember to check that the variables on which the formula variable is based also have Kept status set to Yes.

Adding a Formula Variable By Using the Interactive Interface

The formula variables UDAY and UWEEK can be useful when reporting on data in your PDB. To create them if they do not already exist:

  1. Follow this path from the main menu:

    Administration -> Manage Tables ->select the table -> click right mouse button -> Properties -> General -> Variables

  2. For one formula variable, for instance UWEEK, select Tools and Create Formula. IT Service Vision displays the Create New Formula window. Type in the variable name UWEEK and select OK. IT Service Vision displays the Make/Edit Formula window. Select General.

  3. Select the levels at which you want the formula calculated. In this case, select Detail, Day, Week, Month, and Year in the Apply to level field.

    Note: If you choose to define a formula variable for multiple levels, you must be sure that any variables on which it is based have a Kept status of Yes and any statistics on which it is based are selected at those levels and their base variables have a Kept status of Yes.

  4. Specify the length. In this case, type over the 8 with a 6 in the Length field.

  5. Select the data type. In this case, select Numeric in the Type field.

  6. Select the Kept status. In this case, select Yes in the Kept in PDB field.

  7. Specify the label. In this case, type Week in the Label field.

  8. Specify the description. In this case, in the Description field type The Sunday immediately previous to the date in DATETIME.
  9. Select Formula Source. If you have questions about what constitutes a valid formula, select Help. You are presented with a largely blank window with numbers on the left side. Type in the formula to calculate values for the formula variable; in this case define UWEEK as follows:
    UWEEK = datepart(datetime) - weekday(datepart(datetime)) + 1;

    and then select Check Code. The results of the check display in the message area at the bottom of the SAS window.

  10. Select Advanced and provide the subject and format, if applicable. In this case, select the right arrow that is associated with the Format field, date7., and OK. Edit the format to DATE. and then select OK. Note that the new formula variable is now on the list of variables.

Repeat these steps to define another formula variable, UDAY, which has the formula:

UDAY = weekday(datepart(datetime));

and the description number of the day of the week (1-7), where 1=Sunday, and defaults for the remaining values.

To return to the main window, select Close -> OK -> Close -> OK.

Note: Your views will be rebuilt.

To examine the effect of defining the formula variable, follow this path from the main window:

Administration -> Examine PDB Data -> select a table/level combination that you want to check -> click right mouse button -> View Data

Use the scroll bars to view the UDAY and UWEEK values for each observation (if you have data).

Note: For other browsing methods, see the information on the Print Report Style in the GUI or see the information about the %CPPRINT macro in the Macro Reference documentation for IT Service Vision.

Note: Formula variables do not have selectable statistics. If you want statistics on a formula variable, you must define the statistics as formula variables at the desired non-detail levels.