In this section:
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.
The following apply to the use of calculated values:
In Report Painter:
The Report Options dialog box opens at the Computes tab.
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.
If the Compute expression is issued immediately following an Across phrase, only a recap type of the calculation is performed once for all columns.
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.
You can screen on values produced by Compute expressions by using the WHERE TOTAL test.