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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
Dates
 Login/Join
 
Member
posted
Has anyone created full list of date variables that may be called as a report object? I am looking to include date values such as prior weekday, prior business day, prior Monday, prior Friday, prior month end date, prior quarter end date, next month end date, next quarter end date, etc. WF provides a routing called DATEMOV which will accomplish many of the requirements, however in WF 7.1.1 not all of them function correctly - especially in Dialogue Manager.


WF 7.6.10 Unix Oracle
 
Posts: 22 | Location: Milano, Italy | Registered: September 16, 2005Report This Post
Expert
posted Hide Post
http://www.aviter.com/
and buy the book 1001 ways to work with dates in focus.
i trust you've masterd the 'dates' chapter in your 'using functions manual'?




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Expert
posted Hide Post
Wasn't too keen on 7.1.1 flavour but looking forward to the 7.1.3. Let's hope that these problems (have they been accepted by IB as "features") are ironed out.

Any of you people out there with the later version able to test and advise please?

Woody, If you have examples of functions that do not work in DM then please share so that we can be armed beforehand Smiler.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Member
posted Hide Post
Date multipilations are fundamental. And yes, I have "mastered" dates in "Using Functions" manual. My concern is WF 7.1.1. Try the following DM. When using the DATEMOV function with BOM, EOM, BOQ, EOQ, the results are ********. All the others work fine. Thoughts and suggestions welcome.

-SET &TODAY = TODAY('A10');
-SET &PRIBUSDAY = DATEMOV(&YYMD, 'PWD');
-SET &NXTBUSDAY = DATEMOV(&YYMD, 'NWD');
-SET &YESTERDAY = &YYMD-1;
-SET &TOMORROW = &YYMD+1;
-*
-SET &BEGWK = DATEMOV(&YYMD, 'BOW');
-SET &ENDWK = DATEMOV(&YYMD, 'EOW');
-*
-SET &FSTDOM = DATEMOV(&YYMD, 'BOM');
-SET &LSTDOM = DATEMOV(&YYMD, 'EOM');
-*
-SET &BEGQTR = DATEMOV(&YYMD, 'BOQ');
-SET &ENDQTR = DATEMOV(&YYMD, 'EOQ');
-*
-SET &CDAY = EDIT(&YYMD,'$$$$$$99');
-SET &PDAY = EDIT(&YESTERDAY,'$$$$$$99');
-SET &NDAY = EDIT(&TOMORROW,'$$$$$$99');
-TYPE &CDAY - &PDAY - &NDAY
-*
-TYPE TODAY Function &TODAY
-TYPE .
-TYPE Current Day &YYMD
-TYPE Yesterday &YESTERDAY
-TYPE Tomorrow &TOMORROW
-TYPE .
-TYPE Previous Business Day &PRIBUSDAY
-TYPE Next Business Day &NXTBUSDAY
-TYPE .
-TYPE Beginning of Week &BEGWK
-TYPE End of Week &ENDWK
-TYPE .
-TYPE First Day of Month &FSTDOM
-TYPE Last Day of Month &LSTDOM
-TYPE .
-TYPE Beginning of QTR &BEGQTR
-TYPE End of QTR &ENDQTR


WF 7.6.10 Unix Oracle
 
Posts: 22 | Location: Milano, Italy | Registered: September 16, 2005Report This Post
Expert
posted Hide Post
When manipulating dates in Dialog Manager, I have found that converting the DM variable to date format and then applying the DATEMOV function and then converting back to DM variable works best:

-SET &MONDATE0 =
- DATECVT((DATEMOV((DATECVT(&YYMD,'I8YYMD','YYMD')),'BOW')),'YYMD','I8YYMD');

Not pretty to look at, but it works.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
This is for 5.3 and should work for 7.1


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Platinum Member
posted Hide Post
Please show how to get DATEMOVE to work in 7.1.3.

For example, if a date is entered as YYYYMMDD, how can you determine what the beginning date of the week is (the previous Sunday, unless the date entered is a Sunday).

Thank you,

John


WF 7.7.03, Windows 7, HTML, Excel, PDF
 
Posts: 225 | Location: San Francisco Bay Area, California | Registered: October 26, 2006Report This Post
Expert
posted Hide Post
This should work:

-SET &ECHO=ALL;

-SET &DATE1 = '20071202';

-SET &DOWDATE = (DATECVT(&DATE1,'I8YYMD','W'));
-SET &BOWDATEX = 
-  DATECVT((DATEMOV((DATECVT(&DATE1,'I8YYMD','YYMD')),'BOW')),'YYMD','I8YYMD');
-SET &BOWDATE = IF &DOWDATE EQ 7 THEN &DATE1 ELSE
-  DATECVT((DATEADD((DATECVT(&DATE1,'I8YYMD','YYMD')),'D', -1)),'YYMD','I8YYMD');

-TYPE &DATE1 &BOWDATE


For DATEMOV and myself, the week starts on a Monday. I thought setting BUSDAYS to SMTWTFS would affect DATEMOVE's beginning of the week , but it does not, so moving a date to the previous Sunday takes two steps - first move it to the previous Monday and then subtract one day from the date to move it to the previous Sunday. If it's already a Sunday (day 7) don't do anything.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Platinum Member
posted Hide Post
Thanks, Francis.

The results are quite what I'm looking for. 20071210 is a Monday. The dates listed should yield 20071209 as the BOW date. This is what the results were:

&DATE1 &BOWDATE Result
-------- -------- ------
20071209 20071209 Sunday (correct)
20071210 20071209 Sunday (correct)
20071211 20071210 Monday (wrong)
20071212 20071211 Tuesday (wrong)
20071213 20071212 Wednesday (wrong)
20071214 20071213 Thursday (wrong)
20071215 20071214 Friday (wrong)

Any suggestions, so that &BOWDATE, yields the beginning of the week every time instead of the previous day?


WF 7.7.03, Windows 7, HTML, Excel, PDF
 
Posts: 225 | Location: San Francisco Bay Area, California | Registered: October 26, 2006Report This Post
Expert
posted Hide Post
Woody,
quote:
-SET &YESTERDAY = &YYMD-1;
-SET &TOMORROW = &YYMD+1;

For starters, take another crack at the manual.
If &YYMD is 20071231 , then adding 1 to it , while tempting, will give you 20071232, which is not a date.
You need to stay within the date construct.
-SET &TOMORROW = AYMD ( &YYMD, 1, 'I8YYMD');
gives you 20080101
etc.
Another good source is the WebFOCUS KeySheet , a $25 investment worth a zillion, and lists all manner of date variables.
-S.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Expert
posted Hide Post
John,

The only thing that I would change within Francis' suggestion would be to this line -
-SET &BOWDATE = AYMD(&BOWDATEX, -1 ,'I8YYMD');

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
Using your dates -
-SET &DATE1 = '20071209';
-SET &DATE2 = '20071210';
-SET &DATE3 = '20071211';
-SET &DATE4 = '20071212';
-SET &DATE5 = '20071213';
-SET &DATE6 = '20071214';
-SET &DATE7 = '20071215';
-SET &DATE8 = '20071216';
-SET &DATE9 = '20071217';
-RUN
-SET &Cnt = 1;
-REPEAT :Loop 9 TIMES;
-SET &BOWDATEX = DATECVT(DATEMOV(DATECVT(&DATE&Cnt.EVAL,'I8YYMD','YYMD'),'BOW'),'YYMD','I8YYMD');
-SET &BOWDATE = AYMD(&BOWDATEX, -1 ,'I8YYMD');
-TYPE &DATE&Cnt.EVAL &BOWDATE
-SET &Cnt = &Cnt + 1;
-:Loop


Gives -
 20071209 20071209
 20071210 20071209
 20071211 20071209
 20071212 20071209
 20071213 20071209
 20071214 20071209
 20071215 20071216
 20071216 20071216
 20071217 20071216

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
there is a setting to tell WF which day you want to be first day of week...
i'm w/o manuals at the mo' so , uselessly, i can't look it up foryou, but i promise you its there.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Expert
posted Hide Post
thats the one! thanks Tom




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Platinum Member
posted Hide Post
Hi Everyone,

This is what I had com up with:

-SET &DOW_NUMBER1 = (DATECVT(&DATE1,'I8YYMD','W'));
-TYPE DOW_NUMBER1 = &DOW_NUMBER1

-SET &OFFSET = IF &DOW_NUMBER1 NE 7 THEN (&DOW_NUMBER1)* (-1) ELSE 0;
-SET &BOW = AYMD(&DATE1, &OFFSET, 'I8YYMD');
-TYPE OFFSET = &OFFSET BOW = &BOW

AYM and AYMD seem to be easier to use with variables than DATEMOV.


WF 7.7.03, Windows 7, HTML, Excel, PDF
 
Posts: 225 | Location: San Francisco Bay Area, California | Registered: October 26, 2006Report This Post
Expert
posted Hide Post
John,

Glad you got it working Smiler

You could replace the OFFSET calc to
-SET &OFFSET = (DATECVT(&DATE&Cnt.EVAL,'I8YYMD','W')) * (((DATECVT(&DATE&Cnt.EVAL,'I8YYMD','W')) NE 7) * (-1));
to give you the same result without having to hold the day number separately.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Virtuoso
posted Hide Post
quote:
The U.S. English default value is seven (Saturday) meaning that Saturday is the first day of each week


A bit strange...I suppose 7 (as a higher number than 6 and 5 and...) should represent the last day of the week. IMHO Sunday is the last day of the week. (you rest after a whole working week in the WeekEnd).
But apperently Bill Gates rules the agenda nowadays....




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders