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 seraching for a way to convert a DMYY field in order to recieve info in which calendar week (plus year) the date fell. So what i need is a field with the format CW'/'YY. Anyone any idea? Realy apreciate it. Further info: if helpful my DMYY-field is also available as an integer-field.
Thanks and best regards,
FlorianThis message has been edited. Last edited by: Kerry,
You may wish to consider the function HYYWD; it returns the year and week number from a date-time value. It is up to you to make sure that the argument you pass to it is a date-time value.
jimster06 DevStu WF 7.6.11 W7 HTML, PDF, EXL2K
Posts: 252 | Location: USA | Registered: April 15, 2003
You might have to 'tweak' this to get exactly what you want, but I would find the number of days siince 1/1, divide by 7 and concatenate that value onto the year portion of field.
DEFINE FILE CAR
FIRSTDAY/DMYY WITH COUNTRY = 01012012;
FIRST_DAY/YYMD = FIRSTDAY;
YOUR_FIELD/DMYY WITH COUNTRY = &DMYY ;
LAST_DATE/YYMD = YOUR_FIELD;
DAYS/I5 = DATEDIF(FIRST_DAY, LAST_DATE, 'D');
WEEKS/I2 = DAYS/7;
WEEK_ALPHA/A2 = EDIT(WEEKS);
DATE_TXT/A8 = DATECVT(LAST_DATE, 'YYMD', 'A8YYMD') ;
FINAL_ANSWER/A8 = WEEK_ALPHA || '/' || EDIT(DATE_TXT, '9999');
END
Robert F. Bowley Jr. Owner TaRa Solutions, LLC
In WebFOCUS since 2001
Posts: 132 | Location: Gadsden, Al | Registered: July 22, 2005
You'll want to set the WEEKFIRST parameter to either Sunday (1) or Monday (2), depending on what standard your week numbering needs to follow. The default appears to be 6 (Saturday), which makes me wonder in which country the week starts at Saturday?!?
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 :
Originally posted by rfbowley: You might have to 'tweak' this to get exactly what you want, but I would find the number of days siince 1/1, divide by 7 and concatenate that value onto the year portion of field.
DEFINE FILE CAR
FIRSTDAY/DMYY WITH COUNTRY = 01012012;
FIRST_DAY/YYMD = FIRSTDAY;
YOUR_FIELD/DMYY WITH COUNTRY = &DMYY ;
LAST_DATE/YYMD = YOUR_FIELD;
DAYS/I5 = DATEDIF(FIRST_DAY, LAST_DATE, 'D');
WEEKS/I2 = DAYS/7;
WEEK_ALPHA/A2 = EDIT(WEEKS);
DATE_TXT/A8 = DATECVT(LAST_DATE, 'YYMD', 'A8YYMD') ;
FINAL_ANSWER/A8 = WEEK_ALPHA || '/' || EDIT(DATE_TXT, '9999');
END
Ah, if it were that simple! In countries that follow the ISO-8601 standard for week numbering, the first of Januari can fall in week 1 or 52 or 53, depending on whether that date is before or after Wednesday and how many weeks the previous year had.
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 :
Just want to make sure you installed the 64 bit version of WF and not the 32 bit version. I made that mistake on Windows and it did not work. Installed the 64 bit version of WF and everything worked just fine.
Prod: Webfocus 7.6.4 Test: Webfocus 7.6.10 Windows Excel, PDF, HTML