Focal Point
[SOLVED]Join brings back DUPLICATES

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

October 17, 2014, 02:38 PM
QuickLearner
[SOLVED]Join brings back DUPLICATES
I have a join that brings back duplicate values how can I resolve this. I tried using this HIGHEST syntax. Maybe I am using it wrong.

JOIN CAD_EMP_ID IN OFFNSDAT TO ALL PerID IN TELESTAFFROSTER AS J1  

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


WebFOCUS 7.6
Windows, All Outputs
October 17, 2014, 02:46 PM
MartinY
Your duplicates are they from the parent or the child table ?

I don't know your tables, but try using a UNIQUE relationship.

The ALL, UNIQUE, MULTIPLE relationship doesn't work in WF the same way as is in SQL JOIN.
You may need to read a little about it Wink


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
October 17, 2014, 02:55 PM
MartinY
You also may need to use a MATCH FILE instead of a JOIN depending of the expected result...


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
October 17, 2014, 03:01 PM
QuickLearner
quote:
Originally posted by MartinY:
Your duplicates are they from the parent or the child table ?

I don't know your tables, but try using a UNIQUE relationship.

The ALL, UNIQUE, MULTIPLE relationship doesn't work in WF the same way as is in SQL JOIN.
You may need to read a little about it Wink


The duplicates are comming from my ORACLE TABLE. I don't know if that is the parent or the child but it is the OFFNSDAT table in the join.

JOIN CAD_EMP_ID IN OFFNSDAT TO ALL PerID IN TELESTAFFROSTER AS J1    



WebFOCUS 7.6
Windows, All Outputs
October 17, 2014, 03:01 PM
QuickLearner
quote:
Originally posted by MartinY:
You also may need to use a MATCH FILE instead of a JOIN depending of the expected result...


Please elaborate on the MATCH FILE syntax. Thank you.


WebFOCUS 7.6
Windows, All Outputs
October 17, 2014, 03:10 PM
MartinY
Do a little search from DevStudio help content by searching MATCH in the index...


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
October 17, 2014, 03:14 PM
QuickLearner
quote:
Originally posted by MartinY:
Do a little search from DevStudio help content by searching MATCH in the index...


I swear, yall are like the kids in the class that got the TEST, before the TEST and still want me to study. Just give me the TEST. HAHA


WebFOCUS 7.6
Windows, All Outputs
October 17, 2014, 03:15 PM
QuickLearner
quote:
Originally posted by QuickLearner:

The duplicates are comming from my ORACLE TABLE. I don't know if that is the parent or the child but it is the OFFNSDAT table in the join.

JOIN CAD_EMP_ID IN OFFNSDAT TO ALL PerID IN TELESTAFFROSTER AS J1    



WebFOCUS 7.6
Windows, All Outputs
October 17, 2014, 03:21 PM
MartinY
The syntax is not that complicated but to many options to explain here, you must read the help content to be able to do the right thing and example worth a thousand words. Don't be the lazy guy of the class Big Grin

And OFFNSDAT is your parent table in this case...


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
October 17, 2014, 03:24 PM
QuickLearner
quote:
Originally posted by MartinY:
The syntax is not that complicated but to many options to explain here, you must read the help content to be able to do the right thing and example worth a thousand words. Don't be the lazy guy of the class Big Grin

And OFFNSDATE is your parent table in this case...
I realized that what ever your PARENT table is your TABLE FILE OUT has to be named that to. Is that correct...


WebFOCUS 7.6
Windows, All Outputs
October 17, 2014, 03:27 PM
MartinY
The TABLE FILE TblName following the JOINs must always be the first parent's TblName.

I'm saying "first" because you can have multiple JOINs


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
October 18, 2014, 01:30 PM
George Patton
quote:
I swear, yall are like the kids in the class that got the TEST, before the TEST and still want me to study. Just give me the TEST. HAHA

No, we are like the kids in the class who got out our books and put in the time to study and learn the material - and all of us are still studying and learning many years later. There are folks on this forum with 30 years experience with FOCUS. If you think you can just milk their brains ad infinitum without doing a stitch of work yourself you are sadly mistaken.


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP