As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
ID, Color 0001, Red 0001, Green 0001, Blue 0003, Red
another data-set looks like this:
ID, Name 0001,Joe Smith 0002,Bob Smith 0003,Jane Smith
The join looks like this
JOIN LEFT_OUTER ID IN UD0 TO MULTIPLE ID IN UD1 AS J5 END
(There's a define on this that reads as such.)
DEFINE FILE UD1 CNTR/I9 WITH COLOR = 1; END
I go on to write a SUM
TABLE UD1 SUM CNTR AS '' BY NAME ACROSS COLOR ON COLOR SUBTOTAL AS '*Total'
END
Which gives the output:
Red Green Blue *Total Joe Smith . 1 1 1 3 Bob Smith 0 . . . 0 Jane Smith . 1 . . 1
This is almost exactly what my supervisor needs to see. However, how do i suppress the first SUM/ACROSS (i think the above text will show up in red for emphasis) column from printing?
Thanks for your input, it's appreciated,
DrewThis message has been edited. Last edited by: Kerry,
The sample report you posted does not correspond with the (incorrect code) - ACROSS and BY are reversed - SUBTOTAL should be ACROSS-TOTAL, etc.
Let's start with this:
FILEDEF UD0 DISK ud0.txt
FILEDEF UD1 DISK ud1.txt
-RUN
-WRITE UD0 0001 Red
-WRITE UD0 0001 Green
-WRITE UD0 0001 Blue
-WRITE UD0 0003 Red
-WRITE UD1 0001 Joe Smith
-WRITE UD1 0002 Bob Smith
-WRITE UD1 0003 Jane Smith
FILEDEF MASTER DISK UD0.mas
-RUN
-WRITE MASTER FILENAME=UD0, SUFFIX=FIX
-WRITE MASTER SEGNAME=UD0
-WRITE MASTER FIELDNAME=ID , USAGE=A04, ACTUAL=A04, $
-WRITE MASTER FIELDNAME=FIL1 , USAGE=A01, ACTUAL=A01, $
-WRITE MASTER FIELDNAME=COLOUR, USAGE=A05, ACTUAL=A05, $
-RUN
FILEDEF MASTER DISK UD1.mas
-RUN
-WRITE MASTER FILENAME=UD1, SUFFIX=FIX
-WRITE MASTER SEGNAME=UD1
-WRITE MASTER FIELDNAME=ID , USAGE=A04, ACTUAL=A04, $
-WRITE MASTER FIELDNAME=FIL1 , USAGE=A01, ACTUAL=A01, $
-WRITE MASTER FIELDNAME=NAME , USAGE=A10, ACTUAL=A10, $
-RUN
JOIN
LEFT_OUTER ID IN UD1 TO MULTIPLE ID IN UD0
AS J5
END
-RUN
TABLE FILE UD1
SUM CNT.UD1.ID AS ''
BY NAME AS 'Name'
ACROSS COLOUR AS '' ACROSS-TOTAL AS 'Total'
ON TABLE NOTOTAL
ON TABLE SET PAGE NOPAGE
ON TABLE SET ONLINE-FMT STANDARD
END
-RUN
Gives you:
Blue Green Red Total
Name
-----------------------------------------------
Bob Smith 1 0 0 0 1
Jane Smith 0 0 0 1 1
Joe Smith 0 1 1 1 3
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
That column is there because of your left outer join. If you add "WHERE UD1.ID IS NOT MISSING" Bob will not appear at all, because he has a blue colour which is not in the cross-referenced table.
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
That's the sixty-four dollar question. WebFOCUS normally wants to report on data that actually exists.
You could try creating an intermediary HOLD file as in this example, but if there are many ACROSS COLUMN values this may not be a good idea.
FILEDEF UD0 DISK ud0.txt
FILEDEF UD1 DISK ud1.txt
-RUN
-WRITE UD0 0001 Red
-WRITE UD0 0001 Green
-WRITE UD0 0001 Blue
-WRITE UD0 0003 Red
-WRITE UD1 0001 Joe Smith
-WRITE UD1 0002 Bob Smith
-WRITE UD1 0003 Jane Smith
FILEDEF MASTER DISK UD0.mas
-RUN
-WRITE MASTER FILENAME=UD0, SUFFIX=FIX
-WRITE MASTER SEGNAME=UD0
-WRITE MASTER FIELDNAME=ID , USAGE=A04, ACTUAL=A04, $
-WRITE MASTER FIELDNAME=FIL1 , USAGE=A01, ACTUAL=A01, $
-WRITE MASTER FIELDNAME=COLOUR, USAGE=A05, ACTUAL=A05, $
-RUN
FILEDEF MASTER DISK UD1.mas
-RUN
-WRITE MASTER FILENAME=UD1, SUFFIX=FIX
-WRITE MASTER SEGNAME=UD1
-WRITE MASTER FIELDNAME=ID , USAGE=A04, ACTUAL=A04, $
-WRITE MASTER FIELDNAME=FIL1 , USAGE=A01, ACTUAL=A01, $
-WRITE MASTER FIELDNAME=NAME , USAGE=A10, ACTUAL=A10, $
-RUN
SET HOLDLIST=PRINTONLY
SET ASNAMES=ON
SET HOLDFORMAT=ALPHA
SET PAGE=NOLEAD
-RUN
JOIN
LEFT_OUTER ID IN UD1 TO ALL ID IN UD0
AS J5
END
-RUN
TABLE FILE UD1
SUM
CNT.UD0.ID AS ''
BY NAME
ACROSS COLOUR AS COL
ON TABLE HOLD AS H001
END
-RUN
?FF H001
TABLE FILE H001
PRINT
NAME AS 'Name'
Blue
Green
Red
ON TABLE SET ONLINE-FMT STANDARD
END
-RUN
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
Using Francis' example code up to the join, but then putting in this code:
JOIN LEFT_OUTER ID IN UD1 TO MULTIPLE ID IN UD0 AS J5
DEFINE FILE UD1
NR/I5S = IF COLOUR EQ ' ' THEN 0 ELSE 1;
END
TABLE FILE UD1
SUM NR AS ''
BY NAME AS 'Name'
ACROSS COLOUR AS '' ACROSS-TOTAL AS 'Total'
ON TABLE NOTOTAL
ON TABLE SET PAGE NOPAGE
ON TABLE SET NODATA ' '
ON TABLE SET ONLINE-FMT STANDARD
END
-RUN
will get you Bob to appear and the first column to not appear. The first column actually still is there, but since every item in the column is showing as spaces, you don't see it any more.
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007