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     [SOLVED] Week of Year Function

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Week of Year Function
 Login/Join
 
Gold member
posted
I am trying to find the Week of Year if the business uses Fiscial Year not Calendar Year.

Example we start our Fiscial Year on 10/01/2011.

I can get the Week of the Year using calendar year.

-SET &WEEK_OF_YEAR = HPART(HDTTM(DATECVT(&MDYY, I8MDYY, MDYY), 14, 'HMDYYs'), 'WEEK', 'I2');

I need to know how to make the tool think 10/01/2011 is the start of the first week not 01/01/2012.

Thank You,

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


WebFOCUS 7.7 and WebFOCUS 8
Windows, All Outputs
 
Posts: 36 | Registered: August 17, 2010Report This Post
Virtuoso
posted Hide Post
There are some functions for determining fiscal year and fiscal quarter: FIYR, FIQTR, and FIYYQ (described in this new features document: New Features). They may be available in your release. But as yet, there is no function for determining fiscal week.

You might try adding the number of days between 10/1/2011 and 1/1/2012 to your date and then perform the HPART function to get the week. This approach assumes that fiscal year 2012 begins on 10/1/2011.

This message has been edited. Last edited by: Dan Satchell,


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Expert
posted Hide Post
Try doing an offset (MyFiscalYearBeg = DATEDIF ... (of jan 1st next year) - 2 months)... You'll need to do a year check to see when to use next year instead of this year.




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Master
posted Hide Post
If it were me, I'd create a DEFINE FUNCTION for this where the input is the date. Something like this:

DEFINE FUNCTION WK_OF_FY(INDATE/A8YYMD)
  INDATE1/YYMD=INDATE;
  INMTH/M=INDATE1;
  INYEAR/YY=INDATE1;
  FY/I4=IF INMTH LT 10 THEN INYEAR-1 ELSE INYEAR;
  BFY/YYMD=DATECVT(FY*10000+1001,'I8YYMD','YYMD');
  DAYS/I6=INDATE1-BFY;
  WK_OF_FY/I2=(DAYS/7)+1;
END
-RUN

Place this in your edasprof and you can do the followng:

-SET &INDATE=20120123;
-SET &WEEKFY=WK_OF_FY(&INDATE);
-TYPE Date=&INDATE  Week of FY:&WEEKFY
-RUN

and you get this:

Date=20120123 Week of FY:17

No matter what date you pass, you will get the week of the fiscal year for that date.

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


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
Gold member
posted Hide Post
Thank you for your suggestions, this helped.

Solved


WebFOCUS 7.7 and WebFOCUS 8
Windows, All Outputs
 
Posts: 36 | Registered: August 17, 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     [SOLVED] Week of Year Function

Copyright © 1996-2020 Information Builders