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.
Hi all, I am calculating weeknumber from date calculated using AYMD function. when I try to run the below syntax, &YEAR_AND_WEEK is displaying 2016-54 instead of 2017-01.
Consider using a date dimension table with all of these values pre-calculated. That way you could just do an ON TABLE HOLD and -READFILE to parameterize all date values.
"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
Hi RadhikaC, Assumptions: Week 1 starts with 1 January Week 2 starts on the first Sunday after 1 January
Calculate the number of days since the beginning of the year and divide by 7 for the number of weeks. Initial conditions: If the year starts on a Sunday add 1. If the year starts on a different day, call it D, then week 1 is until Saturday. If the day of the date is before D add 2 else add 1.
The code is wrapped in a loop to get random dates.
That gives you the correct year with the week number when January 1st is in week 53 or December 31st is in week 1 and other similar cases where week and year change over on different days.
Remember to set WEEKFIRST to the week numbering scheme that applies to your case, as is mentioned in that link as well.
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 :
That's a misleading comment you put with the SET WEEKFIRST statement. It sets the day of the week (1 to 7) that the week starts with. You can set it to ISO too.
Additionally, you don't need the TABLE request in your case at all:
SET WEEKFIRST=ISO
-RUN
-SET &WEEK = HPART(HGETC(8, 'HYYMD'), 'WEEK', 'I2');
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 :