Subtotal Clause - Tandem ENFORM 058057 Reference Manual

Data management library
Table of Contents

Advertisement

SUBTOTAL Clause

The SUBTOTAL clause allows you to specify the printing of a subtotal for a numeric
target-item. This clause is an optional part of the LIST statement. The syntax for the
SUBTOTAL clause is:
target-item
target-item
by-item
When the SUBTOTAL clause is specified, ENFORM prints the subtotals for each target-
item within a by-item value. ENFORM prints the subtotal in the column of the
target-item being subtotaled and precedes the subtotal by a row of underline characters
specified by the @UNDERLINE option variable. ENFORM marks the subtotal with a
subtotal string specified by the @SUBTOTAL-LABEL option variable. Refer to the
Option Variable clauses in this section.
When a SUBTOTAL OVER clause is used, ENFORM subtotals the target-item each time
the value of the specified by-item changes. When more than one SUBTOTAL OVER
clause is specified, ENFORM prints the subtotals in the order that the clauses are
entered in the LIST statement.
When a SUBTOTAL clause is used without OVER, ENFORM prints a subtotal in the
specified target-item column each time the value of any by-item appearing to the left of
the target-item changes. ENFORM prints the subtotals using a minor to major order
precedence; that is: ENFORM prints the subtotal for the first by-item to the left of the
target-item, followed by the subtotal for the second by-item to the left of the target-item,
and so on until the subtotal for the last by-item appearing in the report is printed.
SUBTOTAL does not generate a grand total at the end of the report. If a grand total is
desired, use the TOTAL clause. The TOTAL clause is described in this section.
If the width of the value of a subtotal exceeds the width of the format specified for a
target-item, an overflow condition occurs causing asterisks to be printed in place of the
value. To prevent this, enlarge the target-item display format by adding an AS clause
to the target-item being subtotaled. The AS clause is described in this section.
058057 Tandem Computers Incorporated
SUBTOTAL [ OVER by-item ]
is a record name, a field name, a numeric literal, a predefined aggregate, a user
aggregate, an arithmetic expression, an IF/THEN/ELSE expression, a user table
name, a user variable, or a System Variable clause. The data type of the target-item
being subtotaled must be numeric.
is the name of a field grouped by a BY or BY DESC clause.
Clauses
SUBTOTAL Clause
5–63

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enform

Table of Contents