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 guess you can say I'm a newbie with WebFOCUS and have come across the below scenario for which I'm not sure how to solution.
-Report is scheduled via report caster to run monthly on the 1st day to show ytd data.
-In report I set current year and previous month -SET &CURR_DATE = &YYMD; -SET &CURR_YEAR = EDIT(&CURR_DATE, '99990101'); -SET &PREV_MONTH = DATECVT(DATEADD(DATECVT(&YYMD,'I8YYMD','YYMD'),'D',-1), 'YYMD', 'I8YYMD');
-I query records where open time is greater than or equal to current year and less than or equal to previous month. ( PROBSUMMARYM1.PROBSUMMARYM1.OPENTIMECONVERT GE CURRENTYEAR ) AND ( PROBSUMMARYM1.PROBSUMMARYM1.OPENTIMECONVERT LE PREVIOUSMONTH )
-Everything runs fine until January 1st comes around. On January 1st I would want the report to do what it did for the previous months but I don't think it's going to work as current year will be 2014 and previous month will be set to 20131231.
- Any suggestions on how to accommodate the year changing and getting YTD results?This message has been edited. Last edited by: <Kathryn Henning>,
Calculate the beginning of the year you use in the filter (you call it &curr_year) based off the previous month, instead of calculating both using today (&YYMD).
Thanks, helpful for getting different dates but do I do the logic in the Where expression?
My where clause is currently
( ACTIVITYM1.ACTIVITYM1.OPERATOR IN ('user1','user2','user3') ) AND ( ACTIVITYM1.ACTIVITYM1.TYPE EQ 'Reopen' ) AND ( ACTIVITYM1.ACTIVITYM1.DATESTAMP GE CURR_YEAR ) AND (ACTIVITYM1.ACTIVITYM1.DATESTAMP LE PREV_MONTH)
Do I need to incorporate something like this?
IF PREVMONTHMOD = '12' THEN (ACTIVITYM1.ACTIVITYM1.DATESTAMP GE PREVYEAR) AND (ACTIVITYM1.ACTIVITYM1.DATESTAMP LE PREV_MONTH) ELSE (ACTIVITYM1.ACTIVITYM1.DATESTAMP GE CURR_YEAR) AND (ACTIVITYM1.ACTIVITYM1.DATESTAMP LE PREV_MONTH)
Using the example variable names above, your filter would be
( ACTIVITYM1.ACTIVITYM1.OPERATOR IN ('user1','user2','user3') ) AND ( ACTIVITYM1.ACTIVITYM1.TYPE EQ 'Reopen' )
AND ( ACTIVITYM1.ACTIVITYM1.DATESTAMP GE &BOY )
AND (ACTIVITYM1.ACTIVITYM1.DATESTAMP LE &LAST_EOM)
&LAST_MTD subtracts one month from the current date. Subtracting a month (instead of 30 days) means that FOCUS handles the issue of months being different lengths for you.
&LAST_EOM takes the date calculated in &LAST_MTD, and determines what the end-of-month date is for that date.
&BOY takes the date calculated in &LAST_EOM and determines what the first day of the year is based on that date.
You don't need to branch your logic based on whether a month is December or not. You will just ask it for the date greater than the calculated BOY through the EOM for last month.
On Jan 1, 2014, those values will be interpreted like this: