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 am trying to get the week number for a particular date field but I am not getting the right week for jan 01. for example, 20150101 the week number should be 1 but it is returning 52. 20160101 the week number should be 1 but it is returning 52. any other days seems to be fine.
calendar_yywk = CAL_YEAR * 100 +HPART(HDTTM( FULL_DATE,8,'HYYMDIA'),'WEEK', 'I2')---> for 20150101 is returning 201552, 20160101 returning 201652 where CAL_YEAR I4 is DATE_INT / 10000, FULL_DATE is the date in YYMD format and DATE_INT is the FULL_DATE in integer format.
Does anyone knows how to solve this?
thanks,
VThis message has been edited. Last edited by: vnf,
WebFOCUS 8.2.0.7, Application Studio, Webfocus Info-Assist iWay Service Manager, iWay Data Migrator Windows, All Outputs IBM DB2/400, MS SQL-Server 2014
The behaviour is correct. What's more of a challenge is to get the correct year printed with that week number at the start or end of a year.
Several RDBMS's provide a separate variant of a to_char pattern to extract the year for use with a week number. For example, to_char(CURRENT_DATE, 'IYYY/IW') gives the ISO-8601 year/week, which results in year 2014 for week 53, regardless of whether we're looking at 2014/12/31 or at 2015/01/01.
In contrast, to_char(CURRENT_DATE, 'YYYY/IW'), which gives the calendar year with the week (for week 53 in 2014, that incorrectly gives 2015 for 2015/01/01)
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 :