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.
I'm trying to join two seperate files that I've not been able to successfully join at this point. We are still very new to the product and learning every day.
We are looking to join together the two files one is a .foc (table1) and the other is a DB2 (table2). Item codes with both being alpha join fine. When I try to join together the WHSE, we cannot get it to go. I've tried converting it in the .mas file to P3 without the zero's, however that did not work.
When I build my summary file as table1 one can I actually change the format over at that time as the best way to go?
Appreciate any and all help!
Thank you,
JCThis message has been edited. Last edited by: Kerry,
Ok so I tried this, however the SQL generated got messed up.
-* File BuildBOXSHP.fex
-* File BuildBOXSHP.fex
-SET &CURRENTYEAR=&DATEYY;
-SET &ONEYEAR=&DATEYY - 1;
-SET &TWOYEAR=&DATEYY - 2;
APP PREPENDPATH imreporting
APP HOLD IMREPORTING
DEFINE FILE ITEMBACKORDERSUMMARY
YR/A4=SQL.SUBSTR(RECORD_ADD_DATE,1,4);
ALPHWHSE/A3=PTOA(ITEMBACKORDERSUMMARY.ITEMBACKORDERSUMMARY.WAREHOUSE, 'P9', 'A3');
END
TABLE FILE ITEMBACKORDERSUMMARY
SUM
ITEMBACKORDERSUMMARY.ITEMBACKORDERSUMMARY.ORDERED_LINES
ITEMBACKORDERSUMMARY.ITEMBACKORDERSUMMARY.BACK_ORDERED_LINES
ITEMBACKORDERSUMMARY.ITEMBACKORDERSUMMARY.CROSS_SHIP_LINES
ITEMBACKORDERSUMMARY.ITEMBACKORDERSUMMARY.ORDERED_QUANTITY
ITEMBACKORDERSUMMARY.ITEMBACKORDERSUMMARY.BACK_ORDERED_QUANTITY
ITEMBACKORDERSUMMARY.ITEMBACKORDERSUMMARY.CROSS_SHIP_QUANTITY
BY LOWEST ITEMBACKORDERSUMMARY.ITEMBACKORDERSUMMARY.ITEM_CODE
BY ITEMBACKORDERSUMMARY.ITEMBACKORDERSUMMARY.ALPHWHSE
BY LOWEST ITEMBACKORDERSUMMARY.ITEMBACKORDERSUMMARY.YR
WHERE (ITEMBACKORDERSUMMARY.ITEMBACKORDERSUMMARY.YR EQ '&CURRENTYEAR' OR '&ONEYEAR' OR '&TWOYEAR');
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET BYDISPLAY ON
ON TABLE SET FORMULTIPLE ON
ON TABLE NOTOTAL
ON TABLE HOLD AS XBOWHSEITEM FORMAT FOCUS INDEX 'ITEMBACKORDERSUMMARY.ITEMBACKORDERSUMMARY.ITEM_CODE'
SQL:
SELECT
SUBSTR(T1."RECORD_ADD_DATE",1,4),
T1."ITEM_CODE",
T1."WAREHOUSE",
T1."ORDERED_QUANTITY",
T1."ORDERED_LINES",
T1."BACK_ORDERED_QUANTITY",
T1."BACK_ORDERED_LINES",
T1."CROSS_SHIP_QUANTITY",
T1."CROSS_SHIP_LINES",
T1."RECORD_ADD_DATE"
FROM
HSIPCORDTA/F560966 T1
WHERE
(SUBSTR(T1."RECORD_ADD_DATE",1,4) IN('2012', '2011', '2010'))
FOR FETCH ONLY;
OLD SQL:
SELECT
T1."ITEM_CODE",
T1."WAREHOUSE",
SUBSTR(T1."RECORD_ADD_DATE",1,4),
SUM(T1."ORDERED_LINES"),
SUM(T1."BACK_ORDERED_LINES"),
SUM(T1."CROSS_SHIP_LINES"),
SUM(T1."ORDERED_QUANTITY"),
SUM(T1."BACK_ORDERED_QUANTITY"),
SUM(T1."CROSS_SHIP_QUANTITY")
FROM
HSIPCORDTA/F560966 T1
WHERE
(SUBSTR(T1."RECORD_ADD_DATE",1,4) IN('2012', '2011', '2010'))
GROUP BY
T1."ITEM_CODE",
T1."WAREHOUSE",
SUBSTR(T1."RECORD_ADD_DATE",1,4)
ORDER BY
T1."ITEM_CODE",
T1."WAREHOUSE",
SUBSTR(T1."RECORD_ADD_DATE",1,4)
FOR FETCH ONLY;
I tried to do this on the report side instead, however it says "join field is not in the table"
DEFINE FILE XBOWHSEITEM
ALPHWHSE/A3=PTOA(XBOWHSEITEM.SEG01.WAREHOUSE, 'P9', 'A3');
END
JOIN
INNER XBOWHSEITEM.SEG01.ITEM_CODE AND XBOWHSEITEM.SEG01.ALPHWHSE IN XBOWHSEITEM
TO MULTIPLE E3ITEMA.E3ITEMA.IITEM AND E3ITEMA.E3ITEMA.IWHSE IN E3ITEMA TAG J1
AS J1
END
TABLE FILE XBOWHSEITEM
SUM
XBOWHSEITEM.SEG01.ORDERED_LINES
XBOWHSEITEM.SEG01.BACK_ORDERED_LINES
XBOWHSEITEM.SEG01.CROSS_SHIP_LINES
BY LOWEST XBOWHSEITEM.SEG01.ITEM_CODE
BY LOWEST XBOWHSEITEM.SEG01.WAREHOUSE
BY LOWEST J0.E3ITEMA.IWHSE
ACROSS LOWEST XBOWHSEITEM.SEG01.YR
WHERE XBOWHSEITEM.SEG01.ITEM_CODE EQ '&ITEM_CODE';
I could be way off with my understanding of the program.
For optimal performance, you should always allow your relational database (DB2 in this case) to do as much of the processing as possible. Joining files on two different platforms is never optimal, particularly if filtering for both data sources is minimal or join-dependent. If at all possible, you should have DB2 join your two tables and apply the filters, not WebFOCUS. If column WAREHOUSE is in fact numeric in one DB2 table and alpha in another, then there is a DBA somewhere that needs remedial training. If the WAREHOUSE column had the same format in both tables, you should be able to simply do this:
JOIN ITEM_CODE AND WAREHOUSE IN ITEMBACKORDERSUMMARY
TO MULTIPLE IITEM AND IWHSE IN E3ITEMA AS J1
END
-*
DEFINE FILE ITEMBACKORDERSUMMARY
YR/A4=SQL.SUBSTR(RECORD_ADD_DATE,1,4);
END
-*
TABLE FILE ITEMBACKORDERSUMMARY
SUM
ITEMBACKORDERSUMMARY.ORDERED_LINES
ITEMBACKORDERSUMMARY.BACK_ORDERED_LINES
ITEMBACKORDERSUMMARY.CROSS_SHIP_LINES
ITEMBACKORDERSUMMARY.ORDERED_QUANTITY
ITEMBACKORDERSUMMARY.BACK_ORDERED_QUANTITY
ITEMBACKORDERSUMMARY.CROSS_SHIP_QUANTITY
BY ITEMBACKORDERSUMMARY.ITEM_CODE
BY ITEMBACKORDERSUMMARY.WAREHOUSE
ACROSS YR
WHERE (YR EQ '&CURRENTYEAR' OR '&ONEYEAR' OR '&TWOYEAR');
END
I assume there are columns from table E3ITEMA that need to be on the report that you forgot to include in your post, because if not, then no JOIN is necessary. Also, the MULTIPLE keyword in the JOIN statement may not be necessary because DB2 may automatically perform a one-to-many join.
If the WAREHOUSE columns in the two tables have different formats, then try this (by converting column WAREHOUSE to numeric):
JOIN ITEM_CODE AND WHSE_P WITH WAREHOUSE IN ITEMBACKORDERSUMMARY
TO MULTIPLE IITEM AND IWHSE IN E3ITEMA AS J1
END
-*
DEFINE FILE ITEMBACKORDERSUMMARY
YR/A4=SQL.SUBSTR(RECORD_ADD_DATE,1,4);
WHSE_P/P9 = EDIT(WAREHOUSE);
END
-*
TABLE FILE ITEMBACKORDERSUMMARY
SUM
ITEMBACKORDERSUMMARY.ORDERED_LINES
ITEMBACKORDERSUMMARY.BACK_ORDERED_LINES
ITEMBACKORDERSUMMARY.CROSS_SHIP_LINES
ITEMBACKORDERSUMMARY.ORDERED_QUANTITY
ITEMBACKORDERSUMMARY.BACK_ORDERED_QUANTITY
ITEMBACKORDERSUMMARY.CROSS_SHIP_QUANTITY
BY ITEMBACKORDERSUMMARY.ITEM_CODE
BY ITEMBACKORDERSUMMARY.WAREHOUSE
ACROSS YR
WHERE (YR EQ '&CURRENTYEAR' OR '&ONEYEAR' OR '&TWOYEAR');
END
You could use SQL.CAST or SQL.CONVERT in place of EDIT in the DEFINE for field WHSE_P. If WebFOCUS complains about the JOIN (because the WITH clause is necessary for a DEFINE-based JOIN), then move the join on the WAREHOUSE columns to a WHERE clause:
JOIN ITEM_CODE IN ITEMBACKORDERSUMMARY
TO MULTIPLE IITEM IN E3ITEMA AS J1
END
-*
DEFINE FILE ITEMBACKORDERSUMMARY
YR/A4=SQL.SUBSTR(RECORD_ADD_DATE,1,4);
WHSE_P/P9 = EDIT(WAREHOUSE);
END
-*
TABLE FILE ITEMBACKORDERSUMMARY
SUM
ITEMBACKORDERSUMMARY.ORDERED_LINES
ITEMBACKORDERSUMMARY.BACK_ORDERED_LINES
ITEMBACKORDERSUMMARY.CROSS_SHIP_LINES
ITEMBACKORDERSUMMARY.ORDERED_QUANTITY
ITEMBACKORDERSUMMARY.BACK_ORDERED_QUANTITY
ITEMBACKORDERSUMMARY.CROSS_SHIP_QUANTITY
BY ITEMBACKORDERSUMMARY.ITEM_CODE
BY ITEMBACKORDERSUMMARY.WAREHOUSE
ACROSS YR
WHERE (YR EQ '&CURRENTYEAR' OR '&ONEYEAR' OR '&TWOYEAR');
WHERE (E3ITEMA.IWHSE EQ WHSE_P);
END
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
The ordered lines/ Backorder Lines/Cross ship lines live on one system in the format mentioned above. This logs all our stocking items daily (1+ Billion Records in this table). DB2 Format
Our purchasing system lives in another system. (There are approx 900K-1M records in this table). Also DB2
My methodology could be wrong to summarize the 1B+ table yearly at the item/whse level by year (approx 2.7Mish record), then try to add the service information from E3 direct? Should I try and build 2 summary table to link together? Or link the two large files together and just summarize it down from there?
Normally for optimal performance, you want DB2 to perform the join, apply the filters, and summarize the records. But if the two DB2 tables live on two different systems and have two different connection strings, then performance may suffer. I don't have experience with that scenario.This message has been edited. Last edited by: Dan Satchell,
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
When I encounter n issue like this my first reaction is to break it down to the simplest terms - specially when I'm looking for help on FocalPoint.
As you point out, the issue seems to be a lack of a common format for the Warehouse field. So I would strip out all th fields but one and all the code relating to years, and all the report styling and just concentrate on getting the join to work. The styling you have here is irrelevant in any case since you are simply HOLDing the result.