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.
We have a strange problem, we are looking at our inventory changes today vs. yesterday, we have a .fex that will get us the two dates to a hold file, then insert that in list as a where statement on our second query.
This limits our results from a few million record table, but the data is stored like this...
TABLE FILE F568304
BY HIGHEST 2 JOBDATE
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE SAVE AS 'HOLD1' FORMAT ALPHA
END
We want to subtract by the different dates in the rows, this example just gives us the two values for the two days (we tried a few things, but didn't get it to work):
TABLE FILE F568304
SUM
NetChange
BY LOWEST JOBDATE
WHERE ( Q2DXJ IN FILE HOLD1 );
Appreciate any help, once we have a working example we can do this anywhere
*Edits- Cleaned up the example.
Thank you,
JCThis message has been edited. Last edited by: <Kathryn Henning>,
In such cases we use MATCH FILE on the results for today and those for yesterday.
MATCH
FILE F568304
SUM NetChange AS NetChangeToday
WHERE JOBDATE EQ &Today;
RUN
FILE F568304
SUM NetChange AS NetChangeYesterday
WHERE JOBDATE EQ &Yesterday;
AFTER MATCH HOLD OLD-OR-NEW
END
TABLE FILE HOLD
SUM Diff/D12.2 = NetChangeToday - NetChangeYesterday;
END
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :
We would do a define or compute /* DEFINE FILE F568304 NETTODAY/D20.2=IF JOBDATE EQ &TODAY THEN Netchange ELSE 0; NETYESTR/D20.2=IF JOBDATE EQ &YESTERDAY THEN Netchange ELSE 0; END TABLE FILE F568304 SUM NETTODAY NETYESTR COMPUTE NETCHANGE/D20.2= NETYESTR - NETTODAY;
WHERE JOBDATE EQ &TODAY OR &YESTERDAY END
WF 7.6.11 Oracle WebSphere Windows NT-5.2 x86 32bit
-SET &BASEDATE = &YYMD ;
-SET &TODAY = DATECVT (&BASEDATE,'I8YYMD','YYMD');
-SET &YESTERDAY = DATEADD(&TODAY, 'D', -1);
DEFINE FILE F568304
NETTODAY/D20.2=IF JOBDATEEQ &TODAY THEN NETCHANGE ELSE 0;
NETYESTR/D20.2=IF JOBDATEEQ &YESTERDAY THEN NETCHANGE ELSE 0;
END
TABLE FILE F568304
SUM NETTODAY NETYESTR
COMPUTE NETCHANGE/D20.2= NETYESTR - NETTODAY;
WHERE JOBDATEEQ &TODAY OR &YESTERDAY
END
FOCUSEXE:
SET TRACEOFF = ALL
SET TRACEON = STMTRACE//CLIENT
SET TRACEON = STMTRACE/2/CLIENT
SET TRACEUSER = ON
SET XRETRIEVAL = OFF
-SET &BASEDATE = 20130419 ;
-SET &TODAY = DATECVT (20130419,'I8YYMD','YYMD');
-SET &YESTERDAY = DATEADD(41017, 'D', -1);
DEFINE FILE F568304
NETTODAY/D20.2=IF JOBDATEEQ 41017 THEN NETCHANGE ELSE 0;
NETYESTR/D20.2=IF JOBDATEEQ 41016 THEN NETCHANGE ELSE 0;
END
TABLE FILE F568304
SUM NETTODAY NETYESTR
COMPUTE NETCHANGE/D20.2= NETYESTR - NETTODAY;
WHERE JOBDATEEQ 41017 OR 41016
END
SQL:
14.57.57 AE SELECT
14.57.57 AE SUM((CASE (T1."NETCHANGE") WHEN 41017 THEN T1."NETCHANGE" ELSE 0
14.57.57 AE END)),
14.57.57 AE SUM((CASE (T1."NETCHANGE") WHEN 41016 THEN T1."NETCHANGE" ELSE 0
14.57.57 AE END))
14.57.57 AE FROM
14.57.57 AE HSIQDTA71/F568304 T1
14.57.57 AE WHERE
14.57.57 AE (T1."JOBDATE" IN(41017, 41016))
14.57.57 AE FOR FETCH ONLY;
Edits- Made field names more freindly.This message has been edited. Last edited by: John C.,