Description

The AVERAGE Run_Report keyword is used to generate the average of a numeric column and display it at the end of the report. If a Break-On has been specified, Average will also display sub-averages at each break point.

Syntax

AVERAGE COLUMN

Remarks

If Break-On has been specified, AVERAGE will also output sub-averages at each Break-On. The Break-On and Average columns can be different. The final average appears at the end of the report, and is identified by three asterisks (***) in the leftmost column of the report. To substitute an option for the three asterisks, refer to Grand-Total. Any number of columns can be averaged in the report. Average can be used with the modifier DET-SUPP (detail suppress) to create reports with only average values.

Example

/* Print all Customers displaying the Customer Name and Invoice Total fields and averaging the Invoice Total */
stmt = 'LIST CUSTOMERS CUSTOMER_NAME AVERAGE INVOICE_TOTAL'

Run_Report('',stmt)

/* This command will list all CUSTOMERS by order of state, putting a break between each state. 
At each break, the average invoice balance for all customers in that state will be displayed. 
An average of all invoice balances will be displayed at the end of the report. */

stmt = 'LIST CUSTOMERS CUSTOMER_NAME BREAK-ON STATE AVERAGE  '
stmt:= 'INVOICE_TOTAL BY STATE'

Run_Report("",stmt)
  • No labels