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.
Hello, is there a way to define a field consisting of 3 different field concat together coming from 3 different tables (joined together)? When I do it the usual way : A/A3=B|C|D it tells me that fields used in define are coming from more than one data path. Thanks a lot
Use caution when using (or not using as the case may be) ALL|MULTIPLE against RDMBMS. Depending on the optimization settings, FOCUS will try to take over the join, especially when keys are set in the AFD.
Windows: WF 7.6.2: SQL Server 2008 R2
Posts: 86 | Location: Chicago | Registered: August 03, 2007
This code gave me no error messages regarding concatenation:
JOIN
BASEL_BSL_CL_LQ_ACT_D.LQ_ACT_NO IN BASEL_BSL_CL_LQ_ACT_D TO ALL
BASEL_BSL_CL_LQ_ACT_F.LQ_ACT_NO IN BASEL_BSL_CL_LQ_ACT_F AS J1
END
JOIN
BASEL_BSL_CL_LQ_ACT_F.TIME_DIM_KEY IN BASEL_BSL_CL_LQ_ACT_D TO
BASEL_TIME_D.TIME_DIM_KEY IN BASEL_TIME_D AS J2
END
JOIN
BASEL_BSL_CL_LQ_ACT_D.RESP_NODE_ID IN BASEL_BSL_CL_LQ_ACT_D TO
BASEL_BSL_REPTG_RESP_F.RESP_NODE_ID IN BASEL_BSL_REPTG_RESP_F AS J3
END
-RUN
DEFINE FILE BASEL_BSL_CL_LQ_ACT_D
CONCAT1/A200 = BASEL_BSL_CL_LQ_ACT_D.SRC_SYS_ACT_NO | BASEL_TIME_D.DAY_OF_WEEK | BASEL_BSL_REPTG_RESP_F.ADDR_LINE_1;
END
-RUN
TABLE FILE BASEL_BSL_CL_LQ_ACT_D
SUM
CONCAT1
BY CONCAT1
WHERE BASEL_BSL_REPTG_RESP_F.TIME_DIM_KEY EQ 37520;
WHERE READLIMIT EQ 10
END
-RUN
The SQL generated:
SELECT SK001, MAX(VB001) FROM (SELECT ((T1."SRC_SYS_ACT_NO" ||
T4."DAY_OF_WEEK") || T2."ADDR_LINE_1") AS SK001,
((T1."SRC_SYS_ACT_NO" || T4."DAY_OF_WEEK") || T2."ADDR_LINE_1")
AS VB001 FROM BASEL.BSL_CL_LQ_ACT_D T1,BASEL.BSL_REPTG_RESP_F
T2,BASEL.BSL_CL_LQ_ACT_F T3,BASEL.TIME_D T4 WHERE
(T2."RESP_NODE_ID" = T1."RESP_NODE_ID") AND (T3."LQ_ACT_NO" =
T1."LQ_ACT_NO") AND (T4."TIME_DIM_KEY" = T3."TIME_DIM_KEY") AND
(T2."TIME_DIM_KEY" = 37520) ) X GROUP BY SK001 ORDER BY SK001
FETCH FIRST 10 ROWS ONLY FOR FETCH ONLY;
So, whether concatenation works or not depends on the JOIN and on the DEFINE.
The error you're getting is most likely due to what John and Gizmo mention.
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
It actually worked with changing the joins to unique! Thanks a ton everybody! JOIN LEFT_OUTER PRODUCTSKU.PRODUCTSKU.SKUCOLORID IN catalogproduct TO UNIQUE SKUCOLOR.SKUCOLOR.SKUCOLORID IN skucolor AS J1 END JOIN LEFT_OUTER PRODUCTSKU.PRODUCTSKU.SKUSIZEID IN catalogproduct TO UNIQUE SKUSIZE.SKUSIZE.SKUSIZEID IN skusize AS J2 END JOIN LEFT_OUTER PRODUCTSKU.PRODUCTSKU.SKUDESIGNID IN catalogproduct TO UNIQUE SKUDESIGN.SKUDESIGN.SKUDESIGNID IN skudesign AS J3 END DEFINE FILE CATALOGPRODUCT SHRT/A50=SKUCOLOR | SKUSIZE | SKUDESIGN; END
The other option is to do the field as a COMPUTEd field. At the time it is evaluated all extracted data is in the internal table (internal matrix) so the paths are no longer relevant.
I try to use COMPUTEd fields as much as possible rather than DEFINEs if I get the same answer in both cases. COMPUTEd fields will never be less efficient than DEFINEs and as we've seen in other posts you can unintentionally disable optimization when using DEFINEd fields.
ttfn, kp
Access to most releases from R52x, on multiple platforms.
Posts: 346 | Location: Melbourne Australia | Registered: April 15, 2003
Remember where WebFOCUS stems from: from FOCUS. Which is a hierarchical system at heart. This means that the way of looking at data and data structures is still done in terms of segments. When a parent segment has a unique child (SEGTYPE=U, or 1:1 JOIN), this child is treated as if it was part of the parent segment. This is not the case when the child is not unique (SEGTYPE=Sx or 1:n JOIN). In the latter case you will also see missing data for field in the child segment and the ALL parameter suddenly kicks in, while this is not the case with unique childs. This is also the reason for the different database paths. If you have unique segments under your parent and exactly one 1 non-unique, you'll never get a database path error, because all uniques are considered to be part of the parent. You will only get the database pathing error with more than 1 non-unique child segment (or join). And then of course only if you reference fields from both paths in the same request.
In some cases you might be able to circumvent this problem by selecting an alternate entry into your db structure. For instance TABLE FILE CAR.WARRANTY which will read the car database starting from the warranty segment and then work its way up to the root of the file. This does change the logical structure of the file, which you can examine with CHECK FILE CAR.WARRANTY PICT
It's really amazing what this product can do....
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007