Add aggregate fields to a record

In this procedure, you add one or more aggregate fields to a record in a Report Data diagram. For example, you can get the average value of the fields.

To add aggregate fields to a record, you specify aggregation properties for one or more fields existing in the record.

Note:

The aggregationFunctions property is available only for fields in business records for reports (.4rd files), not for forms (.4fd* files) or web services (.4ws or .4wsj files).

  1. Open the Report Data (.4rd) diagram.
    The diagram opens. The record hierarchy displays in the Structure View.
  2. In the Structure View, select the field to aggregate. When an aggregate function is applied to a field in a record, and one or more Order By clauses are defined in the Edit Query dialog, the additional grouped variables are automatically generated in the Data View.
  3. In the Properties view, select the aggregationFunctions property. Click the ellipse to open the Aggregation Functions dialog.
  4. Select the options to include in your aggregation. All the following functions apply within the row group:
    Figure: Aggregation Functions dialog

    Screenshot of Aggregation Functions dialog.
    • AVG - Calculates the average of all values.
    • COUNT - Returns the total number of values in the specified field. This includes values that are spaces or empty strings, but excludes NULL values.
    • DISTINCT COUNT - Returns the number of unique values in the specified field. Includes distinct values that are spaces or empty strings. The unique values excludes NULL values.
    • MAX - Identifies the maximum value.
    • MIN - Identifies the minimum value.
    • SUM - Computes the total sum of all values.
  5. Save your changes.

When you compile your report data, the resulting data schema file includes fields to hold the selected aggregates, one for each grouping level. Like any other data field, these fields are available in the Data View and can be added to your report design document.