PCT Clause
Clauses
058057 Tandem Computers Incorporated
5–55
PCT Clause
The PCT clause prints the percentage of the grand total for a numeric target-item,
based either on a total figure for all instances of the target-item or a total for the
instances of the target-item grouped over a by-item. The syntax of the PCT clause is:
target-item PCT
{
}
OVER ALL
OVER
by-item
target-item
is a field name, a numeric literal, the predefined aggregates SUM and COUNT, an
arithmetic expression, an IF/THEN/ELSE expression, a user table name, a System
Variable clause. The data type of the target-item used in a PCT clause must be
numeric.
If target-item is an expression, that expression cannot contain an aggregate except a
simple SUM or COUNT. If target-item is a user variable, that variable must not
have been assigned an aggregate value unless the value is the result of a simple
SUM or COUNT operation.
by-item
is the name of a numeric field grouped by a BY or BY DESC clause.
Using PCT OVER ALL
When the PCT OVER ALL clause is used, ENFORM prints a percentage of the grand
total for the numeric target-item in place of each target-item value. When only PCT is
specified, ENFORM assumes PCT OVER ALL.
Using PCT OVER By-item
When the PCT OVER by-item clause is used, ENFORM prints the percentage of the
instances of the numeric target-item within the group in place of each target-item value.
The group must have been defined earlier by a BY or BY DESC clause. In the
following example, ENFORM prints the percentage value of the cost of one part over
the total value of all the parts at each location. For example, consider the following
query and report:
LIST BY location,
partnum,
price,
price PCT OVER location;
Part PCT
LOCATION Number PRICE PRICE
-------- ------ --------- ---------
H76 3102 4800.00 66.67
7301 2400.06 33.33
H57 2402 7500.00 41.67
3103 10500.00 58.33
... ... ... ...
Summary of Contents for ENFORM 058057
Page 6: ...New and Changed Information 058057 Tandem Computers Incorporated v...
Page 18: ...Preface xvi 058057 Tandem Computers Incorporated This page left intentionally blank...
Page 19: ...Preface 058057 Tandem Computers Incorporated xvii...
Page 269: ...Glossary Glossary 4 058057 Tandem Computers Incorporated This page left intentionally blank...