Focal Point
[SOLVED] Multiple lookups to address book master

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

September 16, 2013, 07:41 PM
Josh K
[SOLVED] Multiple lookups to address book master
I have the following code where I am joining address book master (F0101) to get the description for one field.

I have another field I need to get the description for..how can I do another lookup to F0101 to get a different row's ABALPH value? I need to do a lookup for TLAN8 = ABAN8.

JOIN TLURAB IN F554852 TO ABAN8 IN F0101 AS J1


TABLE FILE F554852
PRINT
TLDOCO
TLURRF
TLLITM
TLSHFT
TL$SGC
ABALPH AS 'Inspector ID'
TLDGL
TL$MCH
TLLOTS
TLRCD
TLTRQT
TLDOC
TLCRDJ
TLTDAY
BY TL$MCH NOPRINT
BY TLLOTS NOPRINT
BY TLDOCO NOPRINT
BY TLSHFT NOPRINT
WHERE....

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 7.6.9
Windows
all output (Excel, HTML, PDF)
September 16, 2013, 07:53 PM
Waz
Use TAGs.

JOIN TLURAB IN F554852 TO ABAN8 IN F0101 TAG IID AS J1
JOIN TLAN8  IN F554852 TO ABAN8 IN F0101 TAG TLN AS J1

TABLE FILE F554852
PRINT 
IID.ABALPH AS 'Inspector ID'
TLN.ABALPH AS 'TLAN8'



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!

September 17, 2013, 02:42 AM
GamP
Except that you need to name the joins differently. So:
JOIN TLURAB IN F554852 TO ABAN8 IN F0101 TAG IID AS J1
JOIN TLAN8  IN F554852 TO ABAN8 IN F0101 TAG TLN AS J2



GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
September 17, 2013, 04:40 PM
Waz
Ooh,

Schoolboy error.

Eek, well spotted.

The perils of typing and not testing.


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!

September 17, 2013, 04:55 PM
susannah
or use the DB_LOOKUP function and go home early.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
September 17, 2013, 06:05 PM
Waz
Have you used DB_LOOKUP much ?

Hows the performance ?


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!

September 18, 2013, 09:04 AM
jgelona
I could never find a use for DB_LOOKUP and if you are processing thousands of record, seems it would be extremely slow. Also, just as a question, why can't FOCUS data sources be used? From the documentation, "The lookup file can be any non-FOCUS data source..."


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
September 18, 2013, 10:29 AM
susannah
i use db_lookup all the time, everytime i need a field description for a field code.
simplifies life. i never measured performance differences, never was an issue.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
September 18, 2013, 06:05 PM
Josh K
Waz, thanks, it works!


WebFOCUS 7.6.9
Windows
all output (Excel, HTML, PDF)
September 18, 2013, 07:09 PM
Waz
Josh,

Please edit your first post in this thread and add [CLOSED] or [SOLVED] to the title


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!