ENFORM Reference Manual
Aggregates
ENFORM Language Elements
3–16 058057 Tandem Computers Incorporated
The user-aggregate name is grossavg. The formal-argument is x. The step-expression is
(grossavg + .10 * x). The end-expression is grossavg/COUNT (x).
This user-aggregate could be used to compare the new gross salaries to the old
average salary:
LIST AVG (salary), grossavg (salary);
Target Aggregates A target aggregate appears as part of the ENFORM output. When you specify a target
aggregate, follow these rules:
The field names in the target aggregate syntax can come from different data base
records.
Over-item must be a by-item.
Target aggregates cannot be nested; that is, one aggregate cannot be used as the
argument for another aggregate.
The UNIQUE syntax cannot be used with an aggregate computed over a by-item.
Target Aggregate with OVER ALL Syntax
When you specify a target aggregate without specifying either OVER or OVER ALL,
ENFORM assumes OVER ALL. Figure 3-3 shows both a query outline using the
OVER ALL syntax and an output diagram.
Figure 3-3. Query Outline of Target-Aggregate with OVER ALL Syntax
 LIST BY by-item-1, BY by-item-2,
 target-item-1...,
 target-item-2...,
 AVG(target-item-2 OVER ALL);
by-item-1 by-item-2 target- target- AVG
 item-1 item-2 Target-item-2
 |---------|
xxxxx xxxxxx xxxxxx | xxxxxxx | xxxxxxxxxxx
 xxxxxx | xxxxxxx |
 xxxxxx | xxxxxxx |
 xxxxxx xxxxxx | xxxxxxx |
 xxxxxx | xxxxxxx |
xxxxx xxxxxx xxxxxx | xxxxxxx |
 xxxxxx | xxxxxxx |
 xxxxxx | xxxxxxx |
 xxxxxx | xxxxxxx |
 |---------|
 total/number of target-item-2=










