Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Mutilple Join Question
Go
New
Search
Notify
Tools
Reply
  
Mutilple Join Question
 Login/Join
 
<ludo>
posted
Hi all,

After using the search funciton I haven't found yet the answer to my question.

I'll try to explain my problem. I have two table : produit and tiers.
The first one contain two fields and I need to retrieve data from these fields in the second table.

Table produit:
IDPrdoduit
Emetteur (IDTiers)
Structureur (IDTiers)
...

Table Tiers
IDTiers
Nom
code
Rating
..

My join is

 
JOIN EMETTEUR IN PRODUIT TO IDTIERS IN TIERS AS J0
JOIN STRCUTUREUR IN PRODUIT TO IDTIERS IN TIERS AS J1
 


I tried unsuccessfully to output the field rating corresponding to the field emetteur and the one correspondign to the structureur


  
TABLE FILE PRODUIT
PRINT 
J0RATING
J1RATING
BY IDPRODUIT
END


But i have an error regarding the use of hte alias J0 and J1.

So how I could output the rating corresponding to my joined fields ?

Thx a lot

Ludo
 
Reply With QuoteReport This Post
Guru
posted Hide Post
do a search in help or on the forum for TAG...

basically you use the TAG command to alias(prefix) your fields whilst joining them but check the documentation for the exact syntax and usage.


Developer Studio 7.64
Win XP
Output: mostly HTML, also Excel and PDF

"Never attribute to malice that which can be adequately explained by stupidity." - Heinlein's Razor
 
Posts: 285 | Location: UK | Registered: October 26, 2007Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Ludo,

Are you using Focus Files? If so, it should work. See the example below:
  
-* File ludo1.fex
TABLE FILE CAR
WRITE  
MAX.MODEL
BY SEATS
ON TABLE HOLD AS TIERS FORMAT FOCUS INDEX SEATS
END
DEFINE FILE CAR
EM_SEAT/I3=IF MODEL CONTAINS '4 DOOR' THEN 5 ELSE IF MODEL CONTAINS '2 DOOR' THEN 4 ELSE 2;
ST_SEAT/I3=IF MPG GT 20 THEN 5 ELSE IF MPG GT 15 THEN 4 ELSE 2;
END
TABLE FILE CAR
PRINT EM_SEAT ST_SEAT
BY COUNTRY BY CAR
ON TABLE HOLD AS PRODUIT FORMAT FOCUS
END
JOIN EM_SEAT IN PRODUIT TO SEATS IN TIERS AS M_
JOIN ST_SEAT IN PRODUIT TO SEATS IN TIERS AS T_
TABLE FILE PRODUIT
PRINT M_MODEL T_MODEL
BY COUNTRY BY CAR
END


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

 
Posts: 1954 | Location: Tel Aviv, Israel | Registered: March 23, 2006Reply With QuoteReport This Post
<ludo>
posted
Hi thx for your reply.

Is it only works with focus file ? In fact I'm using Oracle Tables ... shall I hold these tables onto a focus file as you did in you example ?

Ludo
 
Reply With QuoteReport This Post
Guru
posted Hide Post
did you try the TAG? that should work regardless of source


Developer Studio 7.64
Win XP
Output: mostly HTML, also Excel and PDF

"Never attribute to malice that which can be adequately explained by stupidity." - Heinlein's Razor
 
Posts: 285 | Location: UK | Registered: October 26, 2007Reply With QuoteReport This Post
<ludo>
posted
nubi,

I'm looking for it but I can find the right sample as the one of Danny-SRL.
 
Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Ludo,

Here is the TAG syntax:
  
-* File ludo2.fex
TABLE FILE CAR
WRITE
MAX.MODEL
BY SEATS
ON TABLE HOLD AS TIERS FORMAT FOCUS INDEX SEATS
END
DEFINE FILE CAR
EM_SEAT/I3=IF MODEL CONTAINS '4 DOOR' THEN 5 ELSE IF MODEL CONTAINS '2 DOOR' THEN 4 ELSE 2;
ST_SEAT/I3=IF MPG GT 20 THEN 5 ELSE IF MPG GT 15 THEN 4 ELSE 2;
END
TABLE FILE CAR
PRINT EM_SEAT ST_SEAT
BY COUNTRY BY CAR
ON TABLE HOLD AS PRODUIT FORMAT FOCUS
END
JOIN EM_SEAT IN PRODUIT TAG P TO SEATS IN TIERS TAG E AS M_
JOIN ST_SEAT IN PRODUIT TAG P TO SEATS IN TIERS TAG S AS T_
TABLE FILE PRODUIT
PRINT E.MODEL S.MODEL
BY COUNTRY BY CAR
END


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

 
Posts: 1954 | Location: Tel Aviv, Israel | Registered: March 23, 2006Reply With QuoteReport This Post
<ludo>
posted
Allrigth it seems to work

Thanks
 
Reply With QuoteReport This Post
Virtuoso
posted Hide Post
quote:
J0RATING
J1RATING

As J0 and 1 weren't 'tags', (but you do need a period 'J0.' if they were), you can also use the table name followed by a period. BUT IN YOUR CASE you need the tags as you are doing a join on different fields to the same table


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Mutilple Join Question

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.