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
Rolling Year
 Login/Join
 
Member
posted
I am trying to create a rolling three-year period for a graph.

TODAY/YYMD=DAYMD(&YYMD, YYMD);
TODAYYR/YY=TODAY;
BEGINYR/YY=TODAYYR - 3;

My BEGINYR would be used in my WHERE statement "WHERE BIRTHYR GT BEGINYR".

It is ignoring my year calculation. Any suggestions?


7.6.8
Windows xp
html
 
Posts: 22 | Location: Minneapolis, MN | Registered: January 24, 2008Report This Post
Virtuoso
posted Hide Post
In the first line, the last arg is wrong.
Make it:

TODAY/YYMD=DAYMD(&YYMD, 'YYMD');


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Virtuoso
posted Hide Post
I think Jack caught your error, but one other thing I wanted to mention. I would HIGHLY suggest doing this calculation in Dialogue Manager using -SET &var= as opposed to a DEFINE. This type of calculation as you are using it cannot be passed to the DBMS so it will basically select *, then do the defines, then throw out the records it doesn't need. If you use DM, you can use the same calculations, but the end result is an &var which has the value substituted in the WHERE as oppposed to comparison agains a defined field. The selection criteria can then be passed directly to the DBMS.

WHERE BIRTHYR GT &BEGINYR.EVAL ;


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, 2007Report This Post
Member
posted Hide Post
Thanks Jack. It appears to be working, however my TODAY and TODAYYR fields return as 2009 now. Other than that it is working correctly. Any idea why 2009 would appear?


7.6.8
Windows xp
html
 
Posts: 22 | Location: Minneapolis, MN | Registered: January 24, 2008Report This Post
Virtuoso
posted Hide Post
Same here!

-SET &ECHO=ON;
DEFINE FILE CAR
TODAY/YYMD=DAYMD(&YYMD, 'YYMD');
TODAYYR/YY=TODAY;
BEGINYR/YY=TODAYYR - 3;
END
TABLE FILE CAR
HEADING
"&YYMD &DATE &DATEYYMD "
" "
PRINT TODAY TODAYYR BEGINYR
BY COUNTRY
ON TABLE PCHOLD FORMAT WP
END

echo:

DEFINE FILE CAR
TODAY/YYMD=DAYMD(20080612, 'YYMD');
TODAYYR/YY=TODAY;
BEGINYR/YY=TODAYYR - 3;
END
TABLE FILE CAR
HEADING
"20080612 06/12/08 2008/06/12 "
" "
PRINT TODAY TODAYYR BEGINYR
BY COUNTRY
ON TABLE PCHOLD FORMAT WP
END


output:
  PAGE     1
  
  20080612 06/12/08 2008/06/12
   
  COUNTRY     TODAY       TODAYYR  BEGINYR                                                                                        
  -------     -----       -------  -------                                                                                        
  ENGLAND     2009/06/12  2009     2006   
  FRANCE      2009/06/12  2009     2006   
  ITALY       2009/06/12  2009     2006   
  JAPAN       2009/06/12  2009     2006   
  W GERMANY   2009/06/12  2009     2006   


Obviously there's a problem with DAYMD. Suggested detour:

TODAY/YYMD='&DATEYYMD';


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
<Dane>
posted
The DAYMD is for Legacy dates only, no detour necessary.
DEFINE FILE CAR
TODAY/YYMD='&YYMD';
TODAYYR/YY=TODAY;
BEGINYR/YY=TODAYYR - 3;
END
TABLE FILE CAR
PRINT TODAY TODAYYR BEGINYR
BY COUNTRY
END
PAGE 1

COUNTRY TODAY TODAYYR BEGINYR
ENGLAND 2008/06/13 2008 2005
FRANCE 2008/06/13 2008 2005
ITALY 2008/06/13 2008 2005
JAPAN 2008/06/13 2008 2005
W GERMANY 2008/06/13 2008 2005
 
Report This Post
Expert
posted Hide Post
Dane,

It would be good to know what version and platform you ran that on. Please update your signature so that we can reference your reply to a version and platform.

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
<Dane>
posted
I tested it on Dev Studio 764, however the release is irrelevent. This will work on all release that support Smart dates.
 
Report This Post
Virtuoso
posted Hide Post
IMHO, the release date is NEVER irrelevant. Constant code changes and code "tightening" cause little things known as bugs or "undocumented features" that appear and disappear seemingly at random. Smiler and Frowner

There are at least a couple of different current issues where date functions using smart dates do not work consistently between versions.


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, 2007Report This Post
Virtuoso
posted Hide Post
quote:
The DAYMD is for Legacy dates only


Ah, yes. DAYMD and "smart" dates use different epochs, 365 days apart:

DAYMD has 1899-12-31 as Day Zero; smart dates, 1900-12-31.


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders