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]Convert dates to week

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[Solved]Convert dates to week
 Login/Join
 
Platinum Member
posted
Hi,

I'm trying to group my dates to weeks. It's grouping them starting with Mon instead of Sun? Data does not calulate correctly either.

Here's what I'm using:

NEWDATE/MDYY=HDATE(ReportDate, 'MDYY');
WDATE/MDYY=DATEMOV(NEWDATE, 'BOW');  


Am I missing something? Thanks for any help you can provide.

Joe

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


WebFocus 7.7.02 WinXP
 
Posts: 236 | Registered: May 12, 2006Report This Post
Virtuoso
posted Hide Post
Joe do a search on the WEEKFIRST function.
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Platinum Member
posted Hide Post
Thanks for the Tip! I will.


WebFocus 7.7.02 WinXP
 
Posts: 236 | Registered: May 12, 2006Report This Post
<JJI>
posted
Joe,

Some time ago I wrote a define function that calculates the week number. The calculation is based on an algorithm I found in Wikipedia
 
DEFINE FUNCTION WEEKNR ( DATUM/DMYY)
DATE_I8YYMD/I8YYMD       = DATECVT(DATUM, 'DMYY', 'I8YYMD');
DAY_OF_WEEK/A4           = DOWK(DATE_I8YYMD, 'A4') ;
WEEKDAYNR/I1             = DECODE DAY_OF_WEEK ( MON 1 TUE 2 WED 3 THU 4 FRI 5 SAT 6 SUN 7 ELSE 9 ) ; 
WEEKTHURSDAY/DMYY        = DATUM + 4 - WEEKDAYNR ;
WEEKYEAR/YY              = WEEKTHURSDAY;
FDAYOFYEAR/A8DMYY        = '0101' || EDIT(WEEKYEAR) ;
FIRSTDAYOFYEAR/DMYY      = FDAYOFYEAR ;
WEEKNR/I2                = ((DATEDIF(FIRSTDAYOFYEAR,WEEKTHURSDAY,'D')) / 7) + 1;
END 


Hope this helps.
 
Report This Post
Platinum Member
posted Hide Post
Thanks! I took pieces of each and was able to fix my issue..Thanks!


WebFocus 7.7.02 WinXP
 
Posts: 236 | Registered: May 12, 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     [Solved]Convert dates to week

Copyright © 1996-2020 Information Builders