PERCENTAGE

PERCENTAGE, PERCENT, PCT, %

Top  Previous  Next

 

The PERCENTAGE field qualifier keyword causes a field to be reported as a percentage of the total of the value of the field in all selected records. Short forms PERCENT, PCT or %.

 

 

Format

 

PERCENTAGE {dp} field {field.qualifiers}

 

where

 

dpis the number of decimal places to be displayed. This defaults to zero if omitted.

 

fieldis the field or evaluated expression to be displayed.

 

field.qualifiers are other field qualifying keywords

 

 

The PERCENTAGE field qualifier keyword is placed before the field name to which it applies and causes the query processor to report the value of the field for each record processed as a percentage of the total value of the field in all selected records. The total percentage (always 100 unless the data has changed during execution of the query) is shown at the end of the report. Used with breakpoints, the PERCENTAGE keyword will also report the percentage value at each breakpoint.

 

If the field is defined as multivalued, the PERCENTAGE keyword operates on each value in turn.

 

The PERCENTAGE keyword operates only on numeric data. Non-numeric values are treated as zero.

 

 

Example

 

The command

 

LIST INVOICES TOTAL VALUE PCT VALUE CUSTOMER.NAME WITH NO AMT.PAID

 

would produce a display such as that below.

 

LIST INVOICES TOTAL VALUE PCT VALUE CUSTOMER.NAME WITH NO AMT.PAID

Invoice  ...Value  Value  Customer...................

74529    £1712.43     87  J McTavish

74273      £95.23      5  County Newspapers

63940     £141.00      7  R Bryant

74993       £9.29      1  Write Right Stationery

        ========  =====

        £1957.95    100

 

4 records listed.