TOTAL |
|
|
The TOTAL field qualifier keyword causes a field to be reported together with its total value.
Format
TOTAL field {field.qualifiers}
where
The TOTAL 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 and also to report the total value at the end of the report. Used with breakpoints, the TOTAL keyword will also report the total value of the field at each breakpoint.
If the field is defined as multivalued, the TOTAL keyword operates on each value in turn.
The TOTAL keyword operates only on numeric data. Non-numeric values are ignored. If the values are a mixture of numerics and non-numerics, the total of the numerics will be reported. If all the values are non-numeric, zero will be reported.
When used with breakpoints, the NO.GRAND.TOTAL keyword can be used to suppress the grand total line, leaving only the subtotals for each breakpoint.
Example
The command
LIST INVOICES TOTAL VALUE CUSTOMER.NAME WITH NO AMT.PAID
would produce a display such as that below in which the total value of the VALUE field is included at the end of the report.
LIST INVOICES TOTAL VALUE CUSTOMER.NAME WITH NO AMT.PAID Invoice ...Value Customer................... 74529 £1712.43 J McTavish 74273 £95.23 County Newspapers 63940 £141.00 R Bryant 74993 £9.29 Write Right Stationery ======== £1957.95 4 records listed. |