Pct Clause; Using Pct Over All; Using Pct Over By-Item - Tandem ENFORM 058057 Reference Manual

Data management library
Table of Contents

Advertisement

PCT Clause

Using PCT OVER ALL

Using PCT OVER By-item

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
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.
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.
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
LOCATION
Number
--------
------
H76
3102
7301
H57
2402
3103
...
058057 Tandem Computers Incorporated
OVER ALL
}
OVER by-item
PRICE
PRICE
---------
---------
4800.00
2400.06
7500.00
10500.00
...
...
PCT
66.67
33.33
41.67
58.33
...
Clauses
PCT Clause
5–55

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enform

Table of Contents