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] HDIFF to find weekdays?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] HDIFF to find weekdays?
 Login/Join
 
Silver Member
posted
I'm having trouble finding the valid "components" to be used with HDIFF. I know that DATEDIF uses WD for weekday but is there an equivalent for HDIFF? I've tried WEEKDAY but it just returns zeros. DAY works correctly, but I need just the week days.

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8.0.09
Windows, All Outputs
 
Posts: 36 | Registered: November 19, 2014Report This Post
Master
posted Hide Post
http://forums.informationbuild...7073226?r=7897073226


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Silver Member
posted Hide Post
Thanks but that isn’t what I’m asking. I want to know what component values can be used with hdiff. I need to know how many week days are between two days.


WebFOCUS 8.0.09
Windows, All Outputs
 
Posts: 36 | Registered: November 19, 2014Report This Post
Master
posted Hide Post
You'll have dig through the ibi.com tech support site, but here is a start.
https://cijfers.duo.nl/ibi_hel...ource/datetime15.htm.

In addition I highly recommend that you buy the book, http://forums.informationbuild...1057331/m/2207090686

Best of luck.


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Silver Member
posted Hide Post
I have searched and searched before posting. As you can see in the link you gave me it does not state what the component values are for hdiff. I can’t find that in any of my searches and have tried every word I can think of for weekday. Datediff documentation says what the values are for that one. Not sure why this is so hard to find for hdiff.


WebFOCUS 8.0.09
Windows, All Outputs
 
Posts: 36 | Registered: November 19, 2014Report This Post
Master
posted Hide Post
Can you post your code?


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Master
posted Hide Post
Read through this post ...

http://forums.informationbuild...1057331/m/5501038331
Can you post the code you have so far to show what you're trying to do?

Thanks


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Expert
posted Hide Post
The "component" parameter is used in other Date Time functions and can be found within the "Using Function / Date-Time Functions" section of the documentation - here.

Click the "Supplying Arguments for Date-Time Functions" link to locate the arguements that can be used.

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
Virtuoso
posted Hide Post
That's one of those cases where there is a lack of hyperlinks in the documentation. If you don't know where to look, the documentation can be a bit frustrating at times.

It also does not help that many of the links in the Index of the online documentation point to non-existent pages... It's all a bit broken as of late.


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
Platinum Member
posted Hide Post
Not sure if this will help ... but here is an example using DATEDIF and the two date parameters are HDATE functions that convert your DateTime fields to Smart Date fields ...

DEFINE FILE CAR
DATE1/HMDYYS = DT(01/08/2018 08:10:20);
DATE2/HMDYYS = DT(01/15/2018 09:20:20);
-*
D_DIFF/I8 = DATEDIF(HDATE(DATE1, 'YYMD'), HDATE(DATE2, 'YYMD'), 'D');
WD_DIFF/I8 = DATEDIF(HDATE(DATE1, 'YYMD'), HDATE(DATE2, 'YYMD'), 'WD');
END
-*
TABLE FILE CAR
PRINT
COUNTRY NOPRINT
DATE1
DATE2
D_DIFF
WD_DIFF
WHERE RECORDLIMIT EQ 1
END


WebFocus 8.201M, Windows, App Studio
 
Posts: 227 | Location: Lincoln Nebraska | Registered: August 12, 2008Report This Post
Silver Member
posted Hide Post
HDIFF ( HGETC ( 8 , 'HMDYYS' ) , SURVEYSENTDATE , 'day' , 'D12.2' )

This returns the correct values.

HDIFF ( HGETC ( 8 , 'HMDYYS' ) , SURVEYSENTDATE , 'weekday' , 'D12.2' )

This only returns zeros. (even if I put WEEKDAY in upper case)


WebFOCUS 8.0.09
Windows, All Outputs
 
Posts: 36 | Registered: November 19, 2014Report This Post
Silver Member
posted Hide Post
quote:
Originally posted by jfr99:
WD_DIFF/I8 = DATEDIF(HDATE(DATE1, 'YYMD'), HDATE(DATE2, 'YYMD'), 'WD');
END

Thank you for the suggestion, this does work.
But I was hoping not to have to manipulate the date/time fields. It should work with HDIFF shouldn't it?


WebFOCUS 8.0.09
Windows, All Outputs
 
Posts: 36 | Registered: November 19, 2014Report This Post
Platinum Member
posted Hide Post
Well ... it doesn't appear to work the same. I'm seeing the same thing you are.

Here's an example ...

DEFINE FILE CAR
DATE1/HMDYYS = DT(01/08/2018 08:10:20);
DATE2/HMDYYS = DT(01/16/2018 09:20:20);
-*
D_HDIFF/D12.2 = HDIFF(DATE2, DATE1, 'DAY', 'D12.2');
WD_HDIFF/D12.2 = HDIFF(DATE2, DATE1, 'WEEKDAY', 'D12.2');
-*
D_DATEDIF/I8 = DATEDIF(HDATE(DATE1, 'YYMD'), HDATE(DATE2, 'YYMD'), 'D');
WD_DATEDIF/I8 = DATEDIF(HDATE(DATE1, 'YYMD'), HDATE(DATE2, 'YYMD'), 'WD');
END
-*
TABLE FILE CAR
PRINT
COUNTRY NOPRINT
DATE1
DATE2
D_HDIFF
WD_HDIFF
D_DATEDIF
WD_DATEDIF
WHERE RECORDLIMIT EQ 1
END

HDIFF and DATEDIF are different animals ... It looks like DATEDIF was built to handle the counting of only week days(WD) or business days(BD) where I'm not sure HDIFF has that capability.

Maybe someone else can explain this better.


WebFocus 8.201M, Windows, App Studio
 
Posts: 227 | Location: Lincoln Nebraska | Registered: August 12, 2008Report This Post
Virtuoso
posted Hide Post
From the documentation of the new simplified DTDIFF function I don't see any support for calculating the difference between two date(time)s in working days. I guess the same applies for HDIFF.

I consider that an omission worth opening a case for.


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
  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] HDIFF to find weekdays?

Copyright © 1996-2020 Information Builders