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 have a date report parameter that is user selected. I would like to get the weekend date for that parameter to compare against other fields in my table file. The date comes across like '2010-03-05'.
Thanks for any and all advice, BThis message has been edited. Last edited by: Kerry,
WebFOCUS 7.7 Windows All Output (Excel, HTML, PDF)
Posts: 31 | Location: Maryland, USA | Registered: April 30, 2010
B, Look up the DATEMOV subroutine. That function will move a date to a variety of points in time. There have been quite a number of posts on this forum about DATEMOV. Use the search button and the name of the function to see what it out there. Use the doc link in the upper right corner of this page to look for the "Using Functions" manual to get a description of the syntax and usage.
You may have to use Dialogue Manager and the EDIT function to string the dashes out before using the subroutine.
Hi I would use the DOWK function in combination the amount of days being less than 7. starting with the given date loop, check the day with DOWK and then increment the given date by 1. Stop when you get 'SAT' or "SUN' as you see fit.THIS WORKS WITH SMARTDATES.If you need a code sample, let me know. regards SteveThis message has been edited. Last edited by: Stefaans,
You can make your own adjustments to get to the specific day you need while still leveraging the functionality of DATEMOV. For instance, if you consider Sunday as being the end of the week but DATEMOV takes you only up to Friday, just add 2 more days to it and you're done. See this:
-SET &TODAY_DT=&YYMD;
-SET &LASTWEEKDAY_DT=DATECVT(DATEMOV(DATECVT(&TODAY_DT, 'I8YYMD','YYMD'), 'EOW'), 'YYMD', 'A8YYMD');
-SET &WEEKEND_DT=DATECVT(DATEADD(DATEMOV(DATECVT(&TODAY_DT, 'I8YYMD','YYMD'), 'EOW'), 'D', 2), 'YYMD', 'A8YYMD');
-TYPE Today is: &TODAY_DT
-TYPE Last week day is: &LASTWEEKDAY_DT
-TYPE Week ends on: &WEEKEND_DT
If your week ends on a Saturday, just substitute 1 for 2 as the last argument in the DATEADD function and that'll do the trick.
Here's an example with actual data, assuming Sunday is the preferred week ending day:
DEFINE FILE GGSALES
WEEKEND_DT/YYMD = DATEADD(DATEMOV(DATECVT(DATE, 'I8YYMD', 'YYMD'), 'EOW'), 'D', 2);
END
TABLE FILE GGSALES
PRINT DATE AS 'Sales,Date' AND WEEKEND_DT AS 'Week Ending,Date'
WHERE RECORDLIMIT EQ 10
END