Totalling a Numeric Attribute

The SUM command calculates a total for the data in a specified numeric attribute. For example, generate a total for dollar amounts such as sales figures or for quantities such as the number of books sold.

Assume that a new advertising campaign was initiated on April 13, 1998 and the user wants to know how many books were sold during the subsequent three months, as compared to the three months prior to the campaign. The next two queries provide this information:

>SUM ORDERS QTY WITH DATE GE "04/13/97" AND LE 07/13/97"

TOTAL OF NUMBER = 578

 

>SUM ORDERS QTY WITH DATE GE "01/13/97" AND LE "04/13/97"

TOTAL OF NUMBER = 332

See Also

Generating Statistics (COUNT, SUM, and STAT)

Counting File Items

Generating Statistics for a Numeric Attribute