User guide

Specifying Computations for a Report
Developing an ENFORM Query
3–34 058058 Tandem Computers Incorporated
Write the SUBTOTAL clause after the element whose values are to be subtotaled.
Unless you specifically indicate otherwise, ENFORM computes the subtotal over all
the by-items in the report. The following example illustrates subtotals for the values of
salary within the by-items regnum and branchnum:
OPEN employee;
LIST BY regnum,
BY branchnum,
job,
salary AS I9 SUBTOTAL;
Report:
REGNUM BRANCHNUM JOB SALARY
------ --------- ----------- ---------
1 1 MANAGER 36000
MANAGER 32000
SALESMAN 19000
SYS.-ANAL. 25000
SECRETARY 12000
SALESMAN 26000
---------
* 150000
2 MANAGER 37000
SALESMAN 30000
* ---------
67000
* ---------
217000
... ... ... ...
When you include the OVER syntax with the SUBTOTAL clause, ENFORM calculates
a subtotal over a named by-item. In the following example, the SUBTOTAL clause
generates a subtotal for the values of quantity over the by-item ordernum:
OPEN odetail;
LIST BY ordernum,
partnum,
quantity SUBTOTAL OVER ordernum;