Enform Plus Reference Manual

Enform Plus Language Elements
Enform Plus Reference Manual422684-001
3-15
Target Aggregates
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 Plus output. When you specify a target
aggregate, follow these rules:
The field names in the target aggregate syntax can come from different database
records.
An 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 Plus uses a default of OVER ALL. Figure 3-3
shows both a query outline using
the OVER ALL syntax and an output diagram.
Specifying the aggregate shown in Figure 3-3
is the same as specifying:
AVG(target-item-2);
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=