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] Current Week Number of a Year

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Current Week Number of a Year
 Login/Join
 
Gold member
posted
I want to calculate Current Week Number of a Year.

I am using WebFOCUS 7.6.1 version.I do not find any function for calculating Current Week Number.

Please help.

Thanks in advance!

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


WebFOCUS 7.6.1
Windows, All Outputs
 
Posts: 50 | Location: Scun-thorpe,UK | Registered: November 14, 2012Report This Post
Virtuoso
posted Hide Post
SET WEEKFIRST=ISO

TABLE FILE CAR
PRINT
COMPUTE TODAY/HYYMDS = HGETC(8, TODAY);
COMPUTE WEEKNR/I3 = HPART(TODAY, 'WEEK', 'I3');
BY COUNTRY
END


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Gold member
posted Hide Post
Its working for me.


Thanks Wep5622.......


WebFOCUS 7.6.1
Windows, All Outputs
 
Posts: 50 | Location: Scun-thorpe,UK | Registered: November 14, 2012Report This Post
Gold member
posted Hide Post
I find a another way to solve this problem...


  -SET &TODAY_DT= &YYMD;
-SET &YEAR = EDIT(&TODAY_DT,'9999$$$$$$$$') ;
-SET &WEEK = HPART(HDTTM(DATECVT(&TODAY_DT, I8YYMD, YYMD), 8, 'HYYMDs'), 'WEEK', 'I2');
-SET &WEEK_OF_YEAR=&WEEK+1;
-SET &YEAR_AND_WEEK=&YEAR|| '-' || &WEEK_OF_YEAR;

-SET &WEEKSTART_DT=DATECVT(DATEADD(DATEMOV(DATECVT(&TODAY_DT, 'I8YYMD','YYMD'), 'BOW'), 'D', -1), 'YYMD', 'A8YYMD');
-SET &WEEKEND_DT=DATECVT(DATEADD(DATEMOV(DATECVT(&TODAY_DT, 'I8YYMD','YYMD'), 'EOW'), 'D', 1), 'YYMD', 'A8YYMD');
-SET &START_DATE =  EDIT(&WEEKSTART_DT,'$$$$$$99')|| '/' ||EDIT(&WEEKSTART_DT,'$$$$99$$$$')|| '/' || EDIT(&WEEKSTART_DT,'9999$$$$$$$$');
-SET &END_DATE =  EDIT(&WEEKEND_DT,'$$$$$$99')|| '/' ||EDIT(&WEEKEND_DT,'$$$$99$$$$')|| '/' || EDIT(&WEEKEND_DT,'9999$$$$$$$$');

-TYPE &YEAR_AND_WEEK
-TYPE &START_DATE 
-TYPE &END_DATE


WebFOCUS 7.6.1
Windows, All Outputs
 
Posts: 50 | Location: Scun-thorpe,UK | Registered: November 14, 2012Report This Post
Virtuoso
posted Hide Post
There are many ways to solve this.
The difference you see now is the first is in a define so you can easy use it in the report but it might depend on the value of the database.
If you want to calculate the week number of a certain transaction you may use this.

The second is an ampervalue you can create independent of the database value.




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

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Current Week Number of a Year

Copyright © 1996-2020 Information Builders