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 came across a problem where I need to find the month number given a week and year number. Is there any function that can help me with this or will I have to burn a few more brain cells implementing some crazy algorythm?
Thanks in advance.This message has been edited. Last edited by: Kerry,
WebFOCUS App Studio 8103 Windows7 All outputs
Posts: 58 | Location: London, UK | Registered: May 09, 2011
Maybe this is something that could help you with your algorithm:
DEFINE FILE CAR
WEEK/I4 WITH COUNTRY = 12;
YEAR/YY WITH COUNTRY = 2004;
FDAY/DMYY = YEAR;
FWEEK/I2 = EDIT(EDIT(HYYWD(HDTTM(FDAY,8,'HYYMDIA'),'A10'),'$$$$$$99'));
FWEEK = IF FWEEK GT 1 THEN 0 ELSE 1;
DAYS = (WEEK - FWEEK) * 7;
HELP/DMYY = FDAY + DAYS;
NEWDATE/MYY = HELP;
END
TABLE FILE CAR
PRINT WEEK YEAR NEWDATE
END
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007
Similar to GamP's solution, but using different functions. First day of the year (JAN01) is converted to the number of days since WF base date (12/31/1900). Number of weeks is multiplied by 7 to obtain number of days. This number is added to the JAN01 base days (minus 1 because we start with the first day of the year). Finally, the total base days are converted back to a month SmartDate and then to a month number. Replace &DATEYY with your year and WEEK_NUMBER with your week number.
APP PREPENDPATH IBISAMP
-*
DEFINE FILE CAR
JAN01/A8YYMD WITH COUNTRY = '&DATEYY' | '0101';
WEEK_NUMBER/I2 WITH COUNTRY = 11 ;
YEAR_NUMBER/I6 = DATECVT(JAN01,'A8YYMD','I6');
DAY_NUMBER/I3L = (WEEK_NUMBER * 7) - 1 ;
YEAR_DAY/I6 = YEAR_NUMBER + DAY_NUMBER ;
YEAR_MONTH/M = DATECVT(YEAR_DAY,'I6','M');
MONTH_NUMBER/I2 = YEAR_MONTH ;
END
-*
TABLE FILE CAR
PRINT
YEAR_NUMBER
DAY_NUMBER
YEAR_DAY
YEAR_MONTH
MONTH_NUMBER
WHERE RECORDLIMIT EQ 1 ;
END
This message has been edited. Last edited by: Dan Satchell,
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007