Focal Point
[CLOSED] Count Distinct - Report Footer

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

May 19, 2009, 02:51 PM
ta2007
[CLOSED] Count Distinct - Report Footer
Have a report with Unit_No and transactions as displayed values in the body of the report. At end of report, would like to show a total count of transactions for the report period and count of the number of unique units the transactions were assopciated with. For example,

Unit_no Trans Code
1232 133
1232 332
3324 998
1232 998
4435 776

Report Total: 3 5

So, there were 5 total transactions (which I have determined how to get the counts for)
and 3 unique units that the transactions are associated with (this is the part I am struggling with).

Any ideas out there?

Thanks!

This message has been edited. Last edited by: Kerry,


7.6.4
XP SP3
EXL2K, HTML, PDF
May 19, 2009, 03:04 PM
Francis Mariani
Something like this:

TABLE FILE CAR
SUM
COMPUTE S_COUNT/D4 = IF SEATS EQ LAST SEATS THEN S_COUNT ELSE S_COUNT + 1; NOPRINT

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
May 19, 2009, 03:05 PM
Prarie
Check out this post here


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
I 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!


7.6.4
XP SP3
EXL2K, HTML, PDF
What 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