December 18, 2007, 10:26 AM
<Shane>Nevermind all...I got it to work by adding ON TABLE SUMMARIZE.
TABLE FILE SALES
SUM
COMPUTE SALES/D12.2!D = RETAIL_PRICE * UNIT_SOLD; AS 'Sales'
UNIT_SOLD AS 'Units'
COMPUTE SALES_PCT/D12.2% = ( UNIT_SOLD / SALES ) * 100; AS '% of Sales'
BY CITY
ON TABLE SUMMARIZE
END
Hope this helps someone else out in the future.
Shane
December 18, 2007, 10:41 AM
Tom FlynnHi Shane,
As simplistic as this was based on your example, I have found that MOST of the time, reports are a bit more complex and SUMMARIZE/RECOMPUTE won't suffice. So, I am a true believer in RECAP/SUBFOOT, especially when needing to style.
Here's an example, based on your SALES code:
DEFINE FILE SALES
DUMMY/A1 = ' ';
END
TABLE FILE SALES
SUM
COMPUTE SALES/D12.2!D = RETAIL_PRICE * UNIT_SOLD; AS 'Sales'
UNIT_SOLD AS 'Units'
COMPUTE SALES_PCT/D12.2% = ( UNIT_SOLD / SALES ) * 100; AS '% of Sales'
BY DUMMY NOPRINT
BY CITY
ON DUMMY RECAP
XSALES/D12.2!D = SALES;
XUNITS/I6 = UNIT_SOLD;
XPCT/D12.2% = (XUNITS / XSALES) * 100;
ON DUMMY SUBFOOT
"Total<XSALES<XUNITS<XPCT"
ON TABLE SET STYLE *
UNITS=IN, SQUEEZE=ON, ORIENTATION=PORTRAIT,$
TYPE=REPORT,
SQUEEZE=ON, GRID=ON, WRAP=ON, FONT='ARIAL', SIZE=9, STYLE=BOLD,$
-********************************************************************
-* Align the TOTALS
-********************************************************************
TYPE=SUBFOOT,
BACKCOLOR=RGB(176 196 222), HEADALIGN=BODY, JUSTIFY=RIGHT,$
TYPE=SUBFOOT,
ITEM=1, JUSTIFY=LEFT,$
END
-EXIT
Just showing there is another way up the WF mountain.
Happy Holidays! to ALL in Paris...