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 don't know if the following is of any use, but it's what I use for one of my reports. BLDATE is a smartdate in my case. I create a datetime field and go from there. I then extrapolate that to periods each containing 4 weeks.
If you first convert your I8YYMD to a smartdate the rest is fairly straightforward.
Also, note that my conversion to a datetime used HYYMDI, not HYYMDS, which cuts out the necessity of dealing with minutes and seconds. ( I wish I had remembered this a couple of weeks ago when I created a new database with a datetime field of HYYMDS and then in subsequent reports had to filter out the time element that I didn't want in the first place)
BLDATETIME/HYYMDI=HDTTM(BLDATE, 8, 'HYYMDI');
WEEKNUM/I2=HPART(BLDATETIME, 'WEEK', 'I2');
PERIOD/I2=IF WEEKNUM EQ 52 THEN 0 ELSE
IF WEEKNUM GE 1 AND WEEKNUM LE 4 THEN 1 ELSE
IF WEEKNUM GE 5 AND WEEKNUM LE 8 THEN 2 ELSE
IF WEEKNUM GE 9 AND WEEKNUM LE 12 THEN 3 ELSE
IF WEEKNUM GE 13 AND WEEKNUM LE 16 THEN 4 ELSE
IF WEEKNUM GE 17 AND WEEKNUM LE 20 THEN 5 ELSE
IF WEEKNUM GE 21 AND WEEKNUM LE 24 THEN 6 ELSE
IF WEEKNUM GE 25 AND WEEKNUM LE 28 THEN 7 ELSE
IF WEEKNUM GE 29 AND WEEKNUM LE 32 THEN 8 ELSE
IF WEEKNUM GE 33 AND WEEKNUM LE 36 THEN 9 ELSE
IF WEEKNUM GE 37 AND WEEKNUM LE 40 THEN 10 ELSE
IF WEEKNUM GE 41 AND WEEKNUM LE 44 THEN 11 ELSE
IF WEEKNUM GE 45 AND WEEKNUM LE 48 THEN 12
ELSE 13;
This message has been edited. Last edited by: George Patton,
If you require ISO8601 week numbers, don't forget to set to set WEEKFIRST.
Week-numbers are dangerous to use if you don't accompany them with the accompanying year, which is not necessarily the same year as the one in the date in weeks 1, 52 and 53.
I just implemented it like this earlier today:
SET WEEKFIRST = ISO2
TABLE FILE FOO
SUM
COMPUTE REQUIRED_READY/HYYMDS = MAX.DATE1; NOPRINT
COMPUTE DAYOFYEAR/D3 = HPART(REQUIRED_READY, 'day-of-year', DAYOFYEAR); NOPRINT
COMPUTE WEEK/D3 = HPART(REQUIRED_READY, 'week', WEEK); NOPRINT
COMPUTE CALYEAR/D4c = HPART(REQUIRED_READY, 'year', CALYEAR); NOPRINT
COMPUTE YEAR/D4c = IF WEEK EQ 1 AND DAYOFYEAR GT 7 THEN CALYEAR +1
ELSE IF WEEK GE 52 AND DAYOFYEAR LT 7 THEN CALYEAR -1
ELSE CALYEAR; NOPRINT
END
I'm fairly certain that's correct, but this time of year is hardly a corner-condition for this code :P
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 :