Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.Opens in a new window

For information on migrating to InterSystems IRISOpens in a new window, see the InterSystems IRIS Migration Guide and Migrating to InterSystems IRIS, both available on the WRC Distributions pageOpens in a new window (login required).

PCT clause

Returns the percent of the total numeric values of a field.

Synopsis

PCT field

Description

The PCT and PERCENT keywords are synonyms.

The PCT clause calculates the percentage of the overall total for a numeric field. Fields containing nonnumeric values or NULL comprise 0 percent of the total.

Multiple CMQL clauses may be specified in any order. The order of application of CMQL clauses is always the same. The PCT clause is applied after the WITH clause, the SAMPLED clause (if present), and the SAMPLE clause (if present).

The following example returns the percent of total for each distinct F5 value. Note that non-numeric values are returned as 0%. The WITH clause eliminates records which have no value (null) for F5:

LIST VOC WITH F5 BY F5 BREAK.ON F5 PCT F5 DET-SUPP
Copy code to clipboard
FeedbackOpens in a new window