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.
sdavis, first you need to know if the date you're working on is via Dialog Manager, or actually a datefield in your data file. You want to make sure your date is a SMART date; that's a specific FOCUS date type. (Its the serial value, the same way dates are handled in excel for instance), and the methods for doing that are different between the two places. Take a look at your manual, WebFocus Using Functions, chapter 7 . its absolutely all there, i promise! Do you have access to the manual? Its downloadable in pdf. ITODAY/I8YYMD = &YYMD ; TODAY/YYMD = ITODAY; THISYEAR/YY = TODAY; YESTERDAY/YYMD = DATEADD(TODAY,'D',-1); LASTYEAR1/YYMD = DATEADD(TODAY,'Y',-1); LASTYEAR/YY = LASTYEAR1 ; NEXT5YEAR1/YYMD = DATEADD(TODAY,'Y',5); NEXT5YEAR/YY = NEXT5YEAR1;
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
Originally posted by Mikel: [qb] Substract 60 months (5 years * 12) from actual Year/Month using AYM() function and concat the actual day. -SET &YM = EDIT(&YYMD, '999999') ; -SET &YM60 = AYM(&YM, -60, 'I6') ; -SET &DATE5 = &YM60 | EDIT(&DMYY, '99') ; -TYPE Actual date: &YYMD -TYPE 5 years before: &DATE5 Regards, Mikel [/qb]
This message has been edited. Last edited by: <Mabel>,
Thank you very much Mike for the information; I will try it and see if it works for me. Appreciate the help.This message has been edited. Last edited by: <Mabel>,
This is the formate of table dim_Time_key FiscalYear Period Week 1 2004 01 1
Date CalendarYear FYPW FYP 2003-03-29 2003 2004011 200401
Date is dateformat, Period and week can be calculated from FYPW. I am trying to get TODAY - 7 as current period because my data gets updated every 7 days, so previous week is my current period and week.
I tried follwing but it didnt work Current = TODAY - 7 CURPERIOD = FYPW WHERE Current = DATE
Orignal question was: How do I get Current Period, Previous 1, Previous 2, Previous 3
Substract 60 months (5 years * 12) from actual Year/Month using AYM() function and concat the actual day.
Try that with a leap year Feb 29 and you come up with an invalid date. I would stick with the DATEADD function.
Regards,
Darin
In FOCUS since 1991 WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex WF Client: 77 on Linux w/Tomcat
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007