Focal Point
[CLOSED] [Thank you]Recursive (Self-Join) in .MAS file?

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

August 06, 2013, 11:21 AM
WF8Developer
[CLOSED] [Thank you]Recursive (Self-Join) in .MAS file?
Can this be done within the master file (.mas)? I only suggest a recursive join, but other techniques may return the desired results.

EXAMPLE:
The file hold 3 fields ID, IDNAME and MASTERID. The MASTERID is the 'parent' of the individual ID.
I'd like to develop a MASTERNAME which is the IDNAME when MASTERID eq ID.

ID IDNAME MASTERID MASTERNAME (VIRTUAL)
10 SMITH COMPANY 10 SMITH COMPANY
11 SMITH OF NY 10 SMITH COMPANY
12 SMITH OF NJ 10 SMITH COMPANY

20 JONES INTL 20 JONES INTL
21 FRANK'S 20 JONES INTL

Not a problem in a .fex

Things that make you go hmmmmm.

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


Production: WebFOCUS 7.703 & 8.104,
All output formats.
Win7-64,MS Office 2013.
Sandbox 8009
August 06, 2013, 01:25 PM
Doug
How about showing the FEX CODE for our enlightenment as to exactly what it is that you want?
August 06, 2013, 02:17 PM
WF8Developer
G'day Doug:

JOIN
CUSTOMER.MASTERID IN CUSTOMER TAG A TO MULTIPLE
CUSTOMER.ID IN CUSTOMER TAG B AS J0
END

TABLE FILE CUSTOMER
PRINT
A.ID AS 'ID'
A.IDNAME AS 'IDNAME'
B.MASTERID AS 'MASTERID'
B.IDNAME AS 'MASTERNAME(VIRTUAL)'
IF B.MASTERID EQ 10
END

Have tried building the .mas manually and with Synonym Editor. No Success.


Production: WebFOCUS 7.703 & 8.104,
All output formats.
Win7-64,MS Office 2013.
Sandbox 8009
August 06, 2013, 03:29 PM
j.gross
create a clustered join, and rename segments and fields as needed.
August 12, 2013, 10:33 AM
WF8Developer
j.gross-

If I understand correctly, we would need at least two .MAS files? Customer and Customer1 that reference the same table. In Customer there would be join statment with a CRFILE=Customer1.

The preference would be to make that happen in 1 .Mas file.

My apology for not making that clear from the get-go.


Production: WebFOCUS 7.703 & 8.104,
All output formats.
Win7-64,MS Office 2013.
Sandbox 8009
August 12, 2013, 12:38 PM
njsden
j.gross suggestion is, in my opinion, the correct way to go. A WebFOCUS synonym does not seem to be able to have references to itself.

Trying to brute-force it renders a (FOC806) RECURSIVE REFERENCE error in 7.7.03M.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
August 12, 2013, 07:24 PM
j.gross
quote:
If I understand correctly, we would need at least two .MAS files


There will be two synonyms -- the original, and the Business View (which will have two segments, both of which reference the original).

In your report you will only reference the BV; but the original must be present and will be read behind the scenes at run time.
August 12, 2013, 07:34 PM
TexasStingray
Why not treat it a as GL Account and use FML.

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




Scott