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
Day of the week
 Login/Join
 
Guru
posted
Hi,

I am using 'DayOfWeek/I1=HPART(SHIFTDATE, 'WEEKDAY', 'I1');
' to return the day number 1 for Sunday, 2 for Monday and so on.
But to force the system to use Monday as the first day of the week, in one fo my reports I did the following:
SET WEEKFIRST=2.
My report is still showing 1 for saturday 2 for Monady and so on.

Is this the usage of WEEKFIRST?.

Thanks


WebFocus 7.6.5
AND WebLogic server as web server
sql2005 as database server
 
Posts: 273 | Location: Europe | Registered: May 31, 2007Report This Post
Expert
posted Hide Post
Try this code to see the differences between taking the WebFOCUS W format and what you are attempting to get -
PRINT SHIFTDATE
      COMPUTE DAY_NO/W   = HDATE(SHIFTDATE, 'YYMD');
      COMPUTE DAY_NOH/I2 = HPART(SHIFTDATE, 'WEEKDAY', 'I2');
IF RECORDLIMIT EQ 100

Try it with and without your WEEKFIRST setting to understand what that setting affects and what is not affected.

Remember, that there may be many ways of doing what you need and you have to think laterally to ensure that you cover those possibilities.

Open your mind Smiler

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
Guru
posted Hide Post
Hi Tony,

Thanks for your answer.

The WEEKFIRST has no impact on the result.
The result of the 2 fields remains unchanged.

How is WEEKFIRST is supposed to impact the result?.

Regards.

Majid


WebFocus 7.6.5
AND WebLogic server as web server
sql2005 as database server
 
Posts: 273 | Location: Europe | Registered: May 31, 2007Report This Post
Expert
posted Hide Post
What does the manual say?

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
Expert
posted Hide Post
the HPART function seems to have a problem
here's a reported problem
and if you look at this thread, there's some discussion today about another problem with the same function;
i couldn't get WEEKFIRST to have any effect on it, either.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Guru
posted Hide Post
Hi Susannah,

That was also the results of my tests. This parameter has no effect on the HPART as it is stated in the documentation.

Thanks for your help.

Regards.


WebFocus 7.6.5
AND WebLogic server as web server
sql2005 as database server
 
Posts: 273 | Location: Europe | Registered: May 31, 2007Report This Post
Expert
posted Hide Post
alas.
We really do need Renee to visit this post and help us out.
Kerry... please ask Renee to visit us.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Member
posted Hide Post
Hi Susannah and all:

I apologize for the day in response but I have been out of the office. I reviewed this thread and the WEEKFIRST setting will not have an effect on the WEEKDAY component in the HPART subroutine. The WEEKFIRST setting is meant to impact the WEEK component. I briefly reviewed the other thread mentioned and that thread is using the WEEK component in conjunction with the WEEKFIRST setting. Ed Wolfgram provided a great deal of useful information and there is the known issue that you pointed to as well. Let me take a look at that other thread in detail and I will update that thread sometime tomorrow.

Renee
 
Posts: 3 | Registered: August 25, 2004Report This Post
Master
posted Hide Post
Majid,

If you are getting 1 for Sunday and want 1 to be Monday, as a work around you could do a decode to change it.
DayofWeek1/I2=DECODE DayOfWeek( 1 7
2 1
3 2
4 3
5 4
6 5
7 6);


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
Expert
posted Hide Post
I'm still looking for a clean solution (without DECODE) to getting the Day of the Week, where Monday is 1.

Can't use the fancy function DATETRAN.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
DEFINE FILE IBISAMP/CAR
TODAY/YYMD WITH COUNTRY = &YYMD.EVAL ;
BOWDATE/YYMD WITH COUNTRY = DATEMOV( TODAY , 'BOW' );
DAYNUM/I2 = 1 + TODAY - BOWDATE ;
END
TABLE FILE IBISAMP/CAR
HEADING
"TODAY IS &DATEwMtDYY"
PRINT TODAY BOWDATE DAYNUM
END

howzat?




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Expert
posted Hide Post
zatisgoot!


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Master
posted Hide Post
Ja, zatisgoot - but I'm confused about something.

I ran the code in the CAR app, and it gave me today's date as Tuesday,Feb 11, when in fact it's Thursday, Feb 13. Then I rejigged it to reference one of my own application and it gave me Thursday.

We have only one server, so what gives ?


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
Expert
posted Hide Post
you've discovered time travel.
its a new feature in 77
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Expert
posted Hide Post
I found something weird with the fancy-schmancy DATETRAN function.

I ignored the comment in the doc that to get the Day of Week, the input date must have only W (Day of Week) format because I thought it was a ridiculous requirement. Of course I get the wrong Day of Week. So you have to transform a YYMD date to W and then use that to get the Day of Week in alpha format, but you can't use DATETRAN to get the Day of Week in numeric format.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
nor can you use DOWK to get it in numeric format.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders