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     Beginning of week (BOW) & End of Week (EOW) in DATEMOV ??

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Beginning of week (BOW) & End of Week (EOW) in DATEMOV ??
 Login/Join
 
Member
posted
In the DATEMOV function, you can have it return a Beginning of week (BOW) value or End of week (EOW) value, which are Monday and Friday respectively.

ex. DATEMOV('2005/05/04','BOW') returns a BOW value of May 2nd for the date of May 4th.

Also, if an event happened on a Saturday WF will create the BOW date as the following Monday.

ex. DATEMOV('2005/05/07','BOW') returns a BOW value of May 9th for the event date of May 7th which is a Saturday.

However, I need that Saturday event to return a BOW value of May 2nd.

In other words, I need to force a week of Sunday - Saturday instead of the WebFOCUS default Saturday - Friday.

Thanks in advance for the help. I am just getting started in WF and have already found this forum to be valuable.
 
Posts: 6 | Location: 1801 California | Registered: July 01, 2005Report This Post
Guru
posted Hide Post
Welcome to WF.
In regard to your query re setting business days, click on "Technical Documentation Library" at the top of this page and search for EOW. The system will return info on how to set up the week.
HTH
 
Posts: 252 | Location: USA | Registered: April 15, 2003Report This Post
Guru
posted Hide Post
I ran into this problem sometime ago, I got around this was by using the function DOWK and moved the date back x number of days.
-SET &DT = '20050701';
-SET &FIRST_W_D = 
DOWK(&DT, 'A3');
-SET &FIRST_W_D = 
DECODE &
FIRST_W_D('SUN' '6' '
MON' '5' 'TUE' '4' 'WED' '3' '
THU' '2' 'FRI' '1' 'SAT' '0');
-SET &DT = AYMD(&DT, &
FIRST_W_D, 'I8');
-SET &END_YYMD = AYMD(&DT, -&TIME_BACK, 'I8');

This message has been edited. Last edited by: <Mabel>,
 
Posts: 406 | Location: Canada | Registered: May 31, 2004Report This Post
Platinum Member
posted Hide Post
Have you tried :

SET WEEKFIRST = 1

never tried it with BOW or EOW but it should work fine.....
 
Posts: 157 | Location: Secaucus, NJ | Registered: May 21, 2004Report This Post
Member
posted Hide Post
I have tried all the suggestions provided. I am able to get the BOW and EOW variables to reflect the dates I am trying for (Sunday - Saturday).

However, the example of the 05/07/2005 (which is a saturday and should be the EOW) is still being returned with a BOW of 05/08/2005.

So this is not working quite yet. If anyone has more suggestions, I would appreciate it. I'm stuck.

Thanks for all your help so far.
 
Posts: 6 | Location: 1801 California | Registered: July 01, 2005Report This Post
Expert
posted Hide Post
Have you tried the business days setting:

SET BUSDAYS = smtwtfs

quote:
The following designates work days as Sunday, Tuesday, Wednesday, Friday, and Saturday:
SET BUSDAYS = S_TW_FS
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Member
posted Hide Post
Yes, I have tried

SET BUSDAY = SMTWTFS

and SET BUSDAYS = SMTWTFS
(I've seen it listed both ways in different pieces of documentation) but to no avail.
 
Posts: 6 | Location: 1801 California | Registered: July 01, 2005Report This Post
Silver Member
posted Hide Post
Hi,

I remember a similar problem and I tried something like this. Am not sure if theres a easier way, but this worked for me.

-SET &FRDT = '05072005' ;
-SET &FRDI = DAMDY(&FRDT,'I8');
-SET &FRBW = DATEMOV(&FRDI, 'BOW');
-SET &DIFF = &FRDI - &FRBW;
-SET &WKFI = IF &DIFF LT 0 THEN DATEMOV(&FRDI + &DIFF -1, 'BOW') ELSE IF &DIFF GT 0 THEN &FRDI - &DIFF ELSE &FRDI;
-SET &WKFR = DTYMD(&WKFI+1,'I8YYMD');
-TYPE &WKFR

M
 
Posts: 33 | Location: New York, USA | Registered: August 11, 2003Report This Post
Silver Member
posted Hide Post
I added the + 1 to get a monday date. I realized that it wont work for a sunday. The original code was for a sunday to saturday week which is

-SET &WKFR = DTYMD(&WKFI ,'I8YYMD');

M
 
Posts: 33 | Location: New York, USA | Registered: August 11, 2003Report This Post
Expert
posted Hide Post
Here's another idea:

Use function DOWK to determine the day of the week for your date:

-SET &DOW = DOWK (&TODAY_DT,'A10');

If &DOW is 'SAT' or 'SUN' subtract 2 from your date (using a date function to do that) and then determine the BOW AND EOW!!!
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Member
posted Hide Post
Finally got it. For anyone who might need this later, Here is what I ended up with and it works. FYI, BOW is always a Monday, and EOW is always a Friday.

Thanks to everyone who gave advice.

SET DEFCENT = 20

DEFINE FILE SO
STDT/MDYY = CLOSED_DT;
day_dowk/I6YMD = CLOSED_DT;
closed_dt_dow/A3=DOWK(day_dowk, 'A3');
STWK/MDYY = IF closed_dt_dow EQ 'SAT' THEN (STDT - 6) ELSE ( DATEMOV (STDT, 'BOW') -1 );
ENDWK/MDYY = IF closed_dt_dow EQ 'SAT' THEN STDT ELSE ( DATEMOV (STDT, 'EOW') + 1 );
 
Posts: 6 | Location: 1801 California | Registered: July 01, 2005Report 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     Beginning of week (BOW) &amp; End of Week (EOW) in DATEMOV ??

Copyright © 1996-2020 Information Builders