Focal Point
[CLOSED] webfocus join help

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

October 14, 2009, 09:02 AM
BDAVIS
[CLOSED] webfocus join help
Hi all,
I am having a little trouble with joining two SQL hold files together in webfocus and I would appreciate it if someone could help.

We have two holdfiles, each containing payroll data. Hold file one contains some demographic information about the employee and overall pay amount. The second hold file contains a bunch of numbers, like sick leave counts, OASI, longevity pay, etc. I want to join the two files together in webfocus on employee_id, pay_month and pay_sequence_number (these columns are in both hold files).

I'd normally do this with a SQL join, but this is a special case. So, can anyone give me an idea of what I need to do here? I've tried something like:

JOIN employee_id AND pay_sequence_number AND pay_month IN table1 TO employee_id AND pay_sequence_number AND pay_month in table2 as table1;

.. but the entire 2nd hold file is left off. If I remove some of the AND clauses, it shows up, but the data is not right.

Any ideas? Thanks in advance.

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


WebFOCUS 7.6.3 | Solaris 10 | Excel, PDF
October 14, 2009, 09:27 AM
GinnyJakes
We need a bit more information. Are the hold files fixed format or really SQL? Have you verified that the formats of all the join fields are identical in both files? If the hold files are truly fixed format, are the files sorted by the 3 join fields? This is an absolute requirement.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
October 14, 2009, 09:27 AM
<JG>
You need to read up on JOIN

When joining flat files OR focus files multi field joins are not supported.

When you extract create a compound key that you can join with.

For preference use FORMAT FOCUS for the JOIN TO hold file and index the key on the file you are joining to.
October 15, 2009, 10:11 AM
BDAVIS
JG, perhaps you could provide me with an example for my situation? I've already hit the manual for this one, but it hasn't been any help.

Ginny - They are like
SQL SQLORA
SELECT * from blah;
TABLE ON TABLE HOLD AS data2
The join field formats are the same.


WebFOCUS 7.6.3 | Solaris 10 | Excel, PDF
October 15, 2009, 10:45 AM
Francis Mariani
these are flat files, but you could still use SQL:

SQL 
SELECT COUNTRY, MODEL, SUM(DEALER_COST) AS TOT_DEALER_COST
FROM CAR 
GROUP BY COUNTRY, MODEL 
ORDER BY COUNTRY, MODEL;
TABLE ON TABLE HOLD AS H001
END

SQL 
SELECT COUNTRY, MODEL, BODYTYPE, SUM(RETAIL_COST) AS RETAIL_COST
FROM CAR
GROUP BY COUNTRY, MODEL, BODYTYPE
ORDER BY COUNTRY, MODEL, BODYTYPE;
TABLE ON TABLE HOLD AS H002
END

SQL
SELECT H001.COUNTRY, H001.MODEL, H002.BODYTYPE, H001.TOT_DEALER_COST, H002.RETAIL_COST
FROM H001
JOIN H002 ON H001.COUNTRY = H002.COUNTRY AND H001.MODEL = H002.MODEL;
END



Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server