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.
Week function EOW to sum Dollars weekly from Sunday to Saturday. I was trying to get the dollars to sum up for the start of the week to the end of the week based on my code BOW2 to EOW2. I thought if I sorted by EOW2 it would work. Instead it shows the EOW2 date an next to it I added the original date "BUDAT" and as you can see below my code ... my example shows the sort date (EOW2) of 2011/01/08 but 2011/01/08 is not included in my cumulative field I calculated called "RTOTAL"..I am not sure why??? here is my code & sample below:
DEFINE FILE GLPCA XWEEK1/A8YYMD=BUDAT; XWEEK2/YYMD=XWEEK1; EXDATE1/YYMD = XWEEK2; BOW1/YYMD = DATEMOV(EXDATE1, 'BOW'); EOW1/YYMD = DATEMOV(EXDATE1, 'EOW'); BOW2/YYMD = DATEADD(BOW1, 'DAY', -1); EOW2/YYMD = DATEADD(EOW1, 'DAY', +1); END TABLE FILE GLPCA SUM KSL COMPUTE RTOTAL/D12C=IF MPLANT EQ LAST MPLANT THEN KSL+RTOTAL ELSE KSL; BY MPLANT BY EOW2 BY EXDATE1 END ------------------- Here is the output:
Francis, The RTOTAL field calculates correctly....the problem is I need to sort the data by plant and the total for each week should be the cumulative total "RTOTAL" from each Sunday to Saturday...as you can see in my report under the code ...even though the endweek(EOW2) is correct that date is NOT included in the week...it's actually in the next week. My problem is how do I sum the dollars from Sunday to Saturday showing the valuse in the report by PLANT across WEEK. thanks
Your code is performing as expected. If you print off the value of EOW1 you should be able to see what is happening.
WebFOCUS has calculated the EOW date for the 08/01/2011 as being the 14/01/2011, adding 1 to this date gives you the 15/01/2011 it doesn't move the EOW calculation in any way.
I believe you are supposed to be able to change which day is the start of the week using some combination of the following settings:
SET BUSDAY SET WEEKFIRST
hopefully someone else who has done this will know the required settings for you.
WF 7.6.11 Output: HTML, PDF, Excel
Posts: 123 | Location: UK | Registered: October 09, 2003
In your DEFINE, the EOW function calculates the End of Week of a Saturday to be the next Friday, then you add one to get a Saturday, that's why the end of week for 2011/01/08 is 2011/01/15.
I'll try to come up with code to deal with this.
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
Using a supplied sample database, here's a solution. If the difference in days between the Date and the normally calculated End-of-week is 6 (meaning the Date is a Saturday), use the Date as the End-of-week, else use the normally calculated End-of-week + 1 as the End-of-week.
DEFINE FILE CENTQA
EXDATE1/YYMD = PROBLEM_DATE;
EOW1/YYMD = DATEMOV(EXDATE1, 'EOW');
EOW2/YYMD = IF DATEDIF(EXDATE1, EOW1, 'D') EQ 6 THEN EXDATE1 ELSE DATEADD(EOW1, 'DAY', +1);
MPLANT/A3 = PLANT;
KSL/D10 = QTY_IN_STOCK;
END
TABLE FILE CENTQA
SUM
KSL
BY EOW2
BY EXDATE
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