Focal Point
[SOLVED] Calculate group total and use in detail report

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/350108571

July 09, 2009, 09:19 AM
HCall
[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,


WF 7.1.6 Platform Windows; Databases Informix, msSQL2000, msSQL2005, Unisys DMSII
Output HTML, EXCEL, PDF
July 09, 2009, 10:32 AM
Francis Mariani
a multi-verb request should do the trick:

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
July 15, 2009, 12:21 PM
HCall
Thanks...that is what I needed!!!!!!


WF 7.1.6 Platform Windows; Databases Informix, msSQL2000, msSQL2005, Unisys DMSII
Output HTML, EXCEL, PDF