Calculating Data
 How to:

You can perform calculations on data in an active report. Types of calculations that you can apply are:

• Count all, which counts the number of occurrences of the field.
• Count distinct, which counts the number of distinct values within a field.
• Recomputes, which inserts a RECOMPUTE function to show totals for columns containing numeric values, and recalculate temporary fields containing information, such as ratios using subtotals, each time a specified sort field changes values.
• Summarize, which uses the SUMMARIZE function to recalculate a computed field at every sort break.

For numeric fields, you can also apply:

• Sum, which sums the values of all the fields in the column.
• Avg, which computes the average value of the field.
• Min, which generates the minimum value of the field.
• Max, which generates the maximum value of the field.
• % of Total, which computes the percentage of a field, based on the total values for the field.

Calculations are applied to the entire data set and to the filtered and/or expanded data in the report. What this means is that reports that have filters applied, or are not fully expanded, will have multiple results appear for calculations. The first is the calculation for the visible data (that is the data that currently appears in the report output). The second is the result for all values in the report even if they are filtered out or are not currently showing in an expandable report.

All calculations appear in the top or bottom row of a report, except the % of Total calculation. The % of Total calculation appears in a new column to the right of the selected column.

When a filter is applied, you can toggle between different displays of calculated data. Calculations are not recalculated on page breaks. Some calculations may initially appear in your report. You can change these.

Calculations on data in the Scientific Notation format are not supported.

The following image shows a filtered report in which the Sum calculation for Quantity appears in the top row and the % of Total calculation appears in a new column to the right of the selected column, Line Total.

 Top of page
Procedure: How to Calculate Data in an Active Technologies Report

Click the arrow in the heading of the column you want to calculate, click Calculate and then the operation.

Calculation results appear in the top or bottom row of the report, depending on how the report is designed.

 Top of page
Procedure: How to Clear Calculations

Click the arrow in the heading of the column where you want to clear calculations. Select Calculate, then Clear (to clear the calculation for the individual column) or Clear All (to clear all calculations).

 Top of page
Procedure: How to Recompute a BY Sort Field in an Active Technologies Report

Recompute recalculates values only at the specified sort break.

1. Select a By sort field in the Report Painter window.
2. Choose Recompute from the Insert menu.

The recomputed field appears in the Report Painter window, indicated by the word *TOTAL.

3. You can add to or type over *TOTAL.

The following image is an example of an HTML active report (AHTML) with Rating as the RECOMPUTE field.

 Top of page
Procedure: How to Summarize a Sort Field in an Active Technologies Report

Summarize recalculates values at all outer sort breaks.

1. Select a By sort field in the Report Painter window.
2. Choose Recompute on all outer sort fields from the Insert menu.

The recomputed field appears in the Report Painter window, indicated by the word *TOTAL.

3. You can add to or type over *TOTAL.

The following image is an example of an HTML active report (AHTML) with Rating as the Summarized field.

 WebFOCUS