Focal Point
Build report with LEFT OUTER JOIN
September 05, 2012, 10:12 AM
AnnaRBuild report with LEFT OUTER JOIN
Hi All, I am struggling with using JOIN function in WebFocus report to get result as left outer join. No matter what I do, I always get result as inner join. Is there a syntax format to be used?
My code is as such:
JOIN
REGION_ID IN USER_DATA TO UNIQUE
REGION_ID IN DIM_REGIONS TAG J1 AS J1
END
TABLE FILE USER_DATA
BY USER_DATA.REGION_ID
BY J1.REGION
SUM UNITS\I8C
I would like this report to show all Regions in User Data that are both, matched and not matched to DIm_Regions.
Any suggestions?
WebFOCUS 7.7, iWay Data Migrator, Windows
Excel, PDF, HTML, XML
September 05, 2012, 10:23 AM
Severus.snapePut this line on top of the JOIN section
SET ALL =ON
or
SET ALL =PASS to include the parent records irrespective of the filter conditions..
thanks
Sashanka
WF 7.7.03/Windows/HTML,PDF,EXL
POC/local Dev Studio 7.7.03 & 7.6.11
September 05, 2012, 10:27 AM
Francis MarianiYou may have to turn LEFT OUTER JOIN capability on, depending on the DBMS:
SQL SQLORA SET SQLJOIN OUTER ON
END
...
SQL DB2 SET SQLJOIN OUTER ON
END
I've also used
SET SHORTPATH = SQL
Change the JOIN syntax:
JOIN LEFT_OUTER CONTRACT_ID IN TEST_CONTRACT TO MULTIPLE CONTRACT_ID IN XJM AS J1
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
September 05, 2012, 02:28 PM
Danny-SRLAnna,
What type are your files USER_DATA and DIM_REGIONS? SQL? FOCUS? Sequential?
Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
September 11, 2012, 10:53 AM
AnnaRThank you all for comments and tips.
Daniel, the files are a mix; there could be a left join from csv (raw) data to a DB2 table or form db2 table to another db2 table.
WebFOCUS 7.7, iWay Data Migrator, Windows
Excel, PDF, HTML, XML