Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Three Table Join using Virtual Fields

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Three Table Join using Virtual Fields
 Login/Join
 
Member
posted
I'm new to studying FOCUS language and attempting to join three tables together. The only hitch is that I need to tweak the joining columns prior to the join. I have used a Virtual field before to join two tables without issue. Adding a third table would seem simple enough but I can't seem to find any documentation on how to do this. Here's a simplified example. When I run this I receive errors that "FIELD2" in Table3 IS NOT RECOGNIZED AND ALSO vFIELD2 USED IN JOIN CANNOT BE FOUND IN THE FILE. How should I do this? I would prefer NOT to modify the master file as other queries have already been created against the masters.
-------------------------------------------------------------------------------------------------------------------------------------
JOIN vFIELD1 WITH FIELD1 IN TABLE1 TO FIELD1 IN TABLE2 TAG J1 AS JOIN1
JOIN vFIELD2 WITH FIELD2 IN TABLE2 TO FIELD2 IN TABLE3 TAG J2 AS JOIN2

DEFINE FILE TABLE1
vFIELD1/A10V = TRIM('L',FIELD1,10,'0',1,vFIELD1);
vFIELD2/A10V = TRIM('L',FIELD2,10,'0',1,vFIELD2);
END

TABLE FILE TABLE1
PRINT
J1.FIELD1
J2.FIELD2
ON TABLE PCHOLD FORMAT HTML
END
-------------------------------------------------------------------------------------------------------------------------------------


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 14 | Registered: November 08, 2011Report This Post
Expert
posted Hide Post
With multiple joins, the host is always the same.

Try changing:

JOIN vFIELD2 WITH FIELD2 IN TABLE2 TO

to

JOIN vFIELD2 WITH FIELD2 IN TABLE1 TO


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Member
posted Hide Post
Thanks but I have Three tables to join:

The join from Table2 to Table3 uses a field from Table2 (not Table1) to join Table3. If the host (Table1) is always the same how can you reference anything from Table2?






(TABLE1) (TABLE2) (TABLE3)
FIELD1 -JOIN- FIELD1 FIELD1
FIELD2 FIELD2 -JOIN- FIELD2
FIELD3 FIELD3 FIELD3


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 14 | Registered: November 08, 2011Report This Post
Expert
posted Hide Post
When you join from table 1 that has already been joined to table 2, you are joining from any of the fields from table 1 or 2.

I would suggest that you have a look at the docuemntation on joins


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
Phil,

Waz is correct.
Once you have issued your first join, all the fields of TABLE2 become, virtually, fields of TABLE1. If you want to join TABLE3 to the joined structure, you join to TABLE1.
Try it.


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Three Table Join using Virtual Fields

Copyright © 1996-2020 Information Builders