Enform Plus Reference Manual
Clauses
Enform Plus Reference Manual—422684-001
5-54
PCT Clause
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
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, or 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 Plus 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 Plus assumes PCT OVER ALL.
Using PCT OVER By-Item
When the PCT OVER by-item clause is used, Enform Plus 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 Plus 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;
target-item PCT { OVER ALL }
{ OVER by-item }