How to: Reference: |
The summary commands SUBTOTAL, SUB-TOTAL, SUMMARIZE, and RECOMPUTE can be used with horizontal sort breaks.
{ACROSS|ON} breakfield [AS 'text1'] sumoption [AS 'text2'] [COLUMNS c1 [AND c2 ...]]
where:
The following request sums units and dollars and calculates the unit cost by product and across region and month. The ACROSS MNTH RECOMPUTE command creates totals of units and dollars, and recomputes the calculated value for the selected months within regions. The ACROSS REGION RECOMPUTE command does the same for the selected regions. The ON TABLE SUMMARIZE command creates summary rows. It has no effect on columns:
DEFINE FILE GGSALES
MNTH/MTr = DATE;
END
TABLE FILE GGSALES
SUM
UNITS/I5 AS 'UNITS' OVER
DOLLARS/I6 AS 'DOLLARS' OVER
COMPUTE DOLLPER/I6 = DOLLARS/UNITS; AS 'UNIT COST'
BY PRODUCT
ACROSS REGION RECOMPUTE AS 'Region Sum' COLUMNS 'Northeast' AND 'West'
ACROSS MNTH RECOMPUTE AS 'Month Sum' COLUMNS 'November' AND 'December'
WHERE DATE FROM '19971101' TO '19971231';
WHERE PRODUCT EQ 'Capuccino' OR 'Espresso';
ON TABLE SUMMARIZE AS 'Grand Total' ON
TABLE HOLD FORMAT HTMLEND
The output is:
Information Builders |