Creating a Calculated Value

In this section:

How to:

Reference:

A calculated value is a temporary field that is evaluated after all the data that meets the selection criteria is retrieved, sorted, and summed. Calculated values are available only for the specified report request.

Use the Computes tab to create a calculated value. You can access the Computes tab only when you are creating reports in Report Painter.


Top of page

x
Reference: Usage Notes for Calculated Field Values

The following apply to the use of calculated values:


Top of page

x
Procedure: How to Create a Calculated Value

In Report Painter:

  1. Choose Computes from the Report menu or click the Compute icon located on the Setup toolbar.

    The Report Options dialog box opens at the Computes tab.

  2. Type the field name in the Field input box.
  3. Enter the desired expression in the expression box.
  4. Click OK.

Top of page

x
Using Positional Column Referencing With Calculated Values

In a COMPUTE command, it is sometimes convenient to refer to a field by its report column position, rather than its name. This option is especially useful when the same field is specified for several report columns.

Column referencing becomes essential when you are using the same field name in a variety of ways. The following image shows that columns produced by display commands (whether displayed or not) can be referred to as C1 for the first column, C2 for the second column, and so forth. The BY field columns are not counted.

using positional column


Top of page

x
Using ACROSS With Calculated Values

If the Compute expression is issued immediately following an Across phrase, only a recap type of the calculation is performed once for all columns.


Top of page

x
Sorting Calculated Values

You can sort a report by a virtual field or a calculated value. To sort by a calculated value, you must use the BY TOTAL phrase in your request.


Top of page

x
Screening on Calculated Values

You can screen on values produced by Compute expressions by using the WHERE TOTAL test.


WebFOCUS