May 19, 2009, 04:07 PM
ta2007I can't use the sum command in place of print and incorporate the cnt. statements there because sum returns a single (last) row (- they're all alpha fields)
So, I thought I could create two hold files - one with details, other with count from same data source - and join them such that cnt fields are appended to each row of the details (DETLS) file.
Here are the two hold files I created for the this approach. Can you create 'open' joins between data sources to accomplish what I want it to do? Kinda like MS Access will apply all data from one source to the other if no specific join is provided...
TABLE FILE SQLOUT
PRINT
EMPLOYEE_NO
EMPLOYEE_NAME
UNIT_NO
VIN
REPLACEMENT_VEH
MODEL_YEAR
MODEL_DESC
TRX_CODE
COMMENTS
UNIT_CNT
TRX_CNT
ON TABLE HOLD AS DETLS
END
TABLE FILE DETLS
SUM
CNT.DST.UNIT_NO AS 'TOTAL_UNITS_CNT'
CNT.TRX_CODE AS 'TOTAL_TRAX_CNT'
ON TABLE HOLD AS RPTTOTS FORMAT FOCUS
Thanks!
May 19, 2009, 04:12 PM
Francis MarianiWhat about a multi-verb request? Like this:
TABLE FILE CAR
SUM
COMPUTE S_COUNT/D4 = IF SEATS EQ LAST SEATS THEN S_COUNT ELSE S_COUNT + 1; NOPRINT
BY SEATS
PRINT
SALES
BY SEATS
BY COUNTRY
BY MODEL
ON TABLE SUBFOOT
"TOTAL UNIQUE SEATS: <S_COUNT"
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