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] Fiscal Year Date Logic

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Fiscal Year Date Logic
 Login/Join
 
Silver Member
posted
I'm sure this topic has been discussed but I don't know how to properly search for it. So please forgive me I did try searching before posting this question.

I'm running a FY report that will run based on the current date. For example if the report is generated before July 1st, the range of data will be 07/1/(year-2) through 06/30/(year-1)
If report is generated on or after July 1st, the range of data will be 07/1(year-1) through 06/30(year)

Does anyone have an example of how this should be written?

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 8206
Exl2k
 
Posts: 36 | Registered: May 23, 2014Report This Post
Expert
posted Hide Post
Fiscal Year Example


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Guru
posted Hide Post
Try this code

/
-SET &FISCAL_MMDDE = '0630' ;
-SET &FISCAL_MMDDB = '0701' ;
-SET &FISCAL_MTH = '07' ;
-SET &CURRENT_MMDD = EDIT(&MDY,'9999') ;
-SET &CURRENT_MTH = EDIT(&MDY,'99') ;
-SET &CURRENT_DATE= EDIT(&MDY,'99') || '/' || EDIT(&MDY,'$$99') || '/' || &THIS_YY ;
-SET &FISCAL_YEAR = IF &CURRENT_MMDD LE &FISCAL_MMDDE THEN &THIS_YY -1 ELSE &THIS_YY ;
-SET &FISCAL_YEAR1 = &FISCAL_YEAR -1 ;
-SET &FISCAL_YEAR2 = &FISCAL_YEAR -2 ;
-SET &FISCAL_MDYY = &CURRENT_MMDD || &FISCAL_YEAR ;
-SET &FISCAL_YYMD = &FISCAL_YEAR || &CURRENT_MMDD;
-SET &FISCAL_BEG = EDIT(&FISCAL_MMDDB,'99') || '/' || EDIT(&FISCAL_MMDDB,'$$99') || '/' || &FISCAL_YEAR ;
-SET &FISCAL_BEG1 = EDIT(&FISCAL_MMDDB,'99') || '/' || EDIT(&FISCAL_MMDDB,'$$99') || '/' || &FISCAL_YEAR1 ;
-SET &FISCAL_BEG2 = EDIT(&FISCAL_MMDDB,'99') || '/' || EDIT(&FISCAL_MMDDB,'$$99') || '/' || &FISCAL_YEAR2 ;
-SET &FISCAL_END1 = EDIT(&FISCAL_MMDDE,'99') || '/' || EDIT(&FISCAL_MMDDE,'$$99') || '/' || &FISCAL_YEAR ;
/


WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
 
Posts: 398 | Registered: February 04, 2008Report This Post
Expert
posted Hide Post
Also check out the FIYR, FIQTR and FIYYQ functions.

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
Platinum Member
posted Hide Post
You might want to check out (almost) 1001 Ways to Work with Dates in WebFocus -- Best doc out on the topic - either book form or PDF --

You can find it at www.aviter.com.

Vivian


Vivian Perlmutter
Aviter, Inc.


WebFOCUS Keysheet Rel. 8.0.2
(Almost) 1001 Ways to Work with Dates thru Rel. 8.0.2
Focus since 1982
WebFOCUS since the beginning
Vivian@aviter.com

 
Posts: 191 | Location: Henderson, Nevada | Registered: April 29, 2003Report This Post
Master
posted Hide Post
The book is extremely valuable even though it could do with a serious redesign. It would help to employ the concept of white space, and put related items on the same or opposite pages, etc. It would be a lot more pages, but much more readable.


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
 
Posts: 674 | Location: Guelph, Ontario, Canada ... In Focus since 1985 | Registered: September 28, 2010Report This Post
Master
posted Hide Post
I have to run reports on State and Federal Fiscal Years.

The state fiscal year (SFY) is like yours, July-June. The federal fiscal year (FFY) is Oct-Sep.

I use the following DEFINE FUNCTION to take the desired date and return the appropriate fiscal year.

-* File getfy.fex
DEFINE FUNCTION GETFY(INDATE/A8YYMD,YRTYP/A1)
-*
-*  For YRTYP S, get SFY for INDATE (Default)
-*  For YRTYP F, get FFY for INDATE
-*
  INDATE1/YYMD=INDATE;
  INMTH/M=INDATE1;
  INYEAR/YY=INDATE1;
  YRTYP=IF NOT YRTYP IN ('F','S') THEN 'S';
  GETFY/I4=
    IF YRTYP EQ 'F' AND INMTH LT 10 OR YRTYP EQ 'S' AND INMTH LT 7
      THEN INYEAR ELSE INYEAR+1;
END
-RUN


Because I use INDATE as A8YYMD format, I can use this anywhere.

Once I have the year, computing the begin and end dates for the year are simple.

-SET &FY=GETFY(&YYMD,'S');
-SET &EFY=&FY*10000+701;
-SET &BEG=&EFY-10000;
-SET &EFY=AYMD(&EFY,-1,'I8YYMD');


If this is run today (20150827), then &FY is 2016, &EFY is 20160701, &BFY is 20150701, then subtracting 1 day from &EFY leaves it as 20160630.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report 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] Fiscal Year Date Logic

Copyright © 1996-2020 Information Builders