[SOLVED] Calculate group total and use in detail report
I need to calculate the total for a group, and have it show on the detail line and use it in some calculations for the detail line.
TABLE FILE ACCTTRANSACTION PRINT ATSELLAMT/P12.2M AS 'SELL AMT'
BY ATSTOREDIVNO AS 'DIV' BY ATALTSTOREID AS 'STORE' BY ATDOCUMENTNO AS 'INVOICE' BY ATTRANSDATE AS 'TRAN DATE' ON ATALTSTOREID SUBTOTAL AS '*TOTAL'
I need the total purchased by a given store to show on the detail line, and then use that to determine a rebate percent based on total purchases for the store.
How can I calculate store total and use it in my report?This message has been edited. Last edited by: Kerry,
TABLE FILE CAR
SUM
COMPUTE TSALES/D10 = SALES; NOPRINT
BY COUNTRY
PRINT
TSALES
SALES/D10
COMPUTE SALES_PCT/D10.2 = SALES / TSALES * 100;
BY COUNTRY
BY CAR
END
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server