Qualification Aggregates; Qualification Aggregate With Over All Syntax; Qualification Aggregate With Over Syntax - Tandem ENFORM 058057 Reference Manual

Data management library
Table of Contents

Advertisement

ENFORM Language Elements
Aggregates
3–18
In this example, AVG target-item-1 prints as a separate report column with a non-
blank entry only on the first line of each new by-item-2 group. This entry represents
the average of target-item-1 over the by-item-2 group.
When a target aggregate is specified in a FIND statement with the OVER syntax, the
aggregate value is present only in the first target-record for a by-item. This field is
blank for all other target-records.

Qualification Aggregates

Qualification aggregates must be specified in a WHERE clause. When specifying a
qualification aggregate, follow these rules:
Qualification aggregates cannot be nested; that is, one aggregate cannot be used as
the argument for another aggregate.
A qualification aggregate can contain an embedded WHERE clause.
The embedded WHERE clause can contain another qualification aggregate;
however, that qualification aggregate must be computed OVER ALL.
All field names used for each individual qualification aggregate expression (the
field being aggregated, any field name appearing in an expression being
aggregated, any field name appearing in the WHERE clause associated with an
aggregate, and any over-item) must come from the same data base record.
The UNIQUE syntax cannot be used with an aggregate computed over an
over-item.

Qualification Aggregate with OVER ALL Syntax

When you specify a qualification aggregate without specifying either OVER or OVER
ALL, ENFORM assumes OVER ALL. ENFORM computes the value for the
qualification aggregate over all the records in the original data base (not over the
target-records). For example:
LIST odetail,
WHERE quantity > AVG (quantity );
restricts the records returned from odetail to those whose quantity field is greater than
the average of all the values of the quantity field.
Qualification Aggregates with OVER Syntax
When a qualification aggregate is used with the OVER syntax, ENFORM computes
one value for each over-item group. When the WHERE clause is evaluated, ENFORM
uses the qualification aggregate value for the particular group to restrict the records
selected. Figure 3-5 shows a query outline and the process that occurs when the OVER
syntax is used.
058057 Tandem Computers Incorporated

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enform

Table of Contents