Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Get weekend date

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Get weekend date
 Login/Join
 
Silver Member
posted
Hello all,

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,
B

This 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, 2010Report This Post
Expert
posted Hide Post
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.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Silver Member
posted Hide Post
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 Steve

This message has been edited. Last edited by: Stefaans,


WebFOCUS 7.7.01 Windows, TSO 7.0
 
Posts: 43 | Registered: April 18, 2007Report This Post
Silver Member
posted Hide Post
Thanks Ginny. I'll have a look


WebFOCUS 7.7
Windows
All Output (Excel, HTML, PDF)
 
Posts: 31 | Location: Maryland, USA | Registered: April 30, 2010Report This Post
Silver Member
posted Hide Post
DATEMOV seems to return either Monday or Friday but not Saturday (ie: Weekend date).


WebFOCUS 7.7
Windows
All Output (Excel, HTML, PDF)
 
Posts: 31 | Location: Maryland, USA | Registered: April 30, 2010Report This Post
Virtuoso
posted Hide Post
Can you show us the piece of code where you're using the function?

This message has been edited. Last edited by: njsden,



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
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.

Hope that helps!



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
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



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Silver Member
posted Hide Post
I figured it out. Here's what I did...
DEFINE FILE FILE1
    SDATE/YYMD=&USERDATE;
    USERWKDAY/W=SDATE;
    USERWKEND/YYMD=DATEADD(SDATE,'D',(7-USERWKDAY)-1);
END 
 


WebFOCUS 7.7
Windows
All Output (Excel, HTML, PDF)
 
Posts: 31 | Location: Maryland, USA | Registered: April 30, 2010Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Get weekend date

Copyright © 1996-2020 Information Builders