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] Calculate Business Hrs Between 2 Dates (8 am -5 pm -Exclude Wkends/Holidays)

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Calculate Business Hrs Between 2 Dates (8 am -5 pm -Exclude Wkends/Holidays)
 Login/Join
 
Member
posted
We are currently using Developer Studio 8.1.05 and we are using a Business & Holiday File to only count Business Days Elapsed between two dates. The Challenge is to calculate Time Elapsed for Business Hours only.

Example 1: Time-In 06/19/2017 08:00 a.m.
Time-Out 06/26/2017 10:00 a.m.
We count 9 hours per Business day, so 5 days from 8 a.m. = 9*5 = 45 business hours, then we count 2 hours for Monday 06/26/2017 from 8 a.m. to 10 a.m.
Final Answer should be in Minutes, but for simplicity I will calculate this example as hours:
Final Answer = 45 hours + 2 = 47 hours elapsed.

Example 2: Time-In 06/19/2017 04:00 p.m.
Time-Out 06/21/2017 07:00 p.m.
We count 1 hour for first day between 4 p.m. and 5 p.m.
We then count 9 hours for Tuesday 06/20/2017.
We then count 9 hours for Wednesday 06/21/2017.
Then we count 1 hour for anything after 5 p.m. or before 8 a.m.; thus we would count 1 hour for the 7 p.m.
Final Answer = 1 hour + 18 hours + 1 = 20 hours.


Thanks in advance for your time and support.

Leo Sanchez

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


WebFOCUS 8

Windows, All Outputs
 
Posts: 1 | Location: Houston, TX | Registered: June 19, 2017Report This Post
Virtuoso
posted Hide Post
Write down your rules based on your calendar (which you seems to already have. Such as between 8am and 5pm then do... Before 8am and after 5pm do...).
Convert them to logical test.
Perform proper Focus coding.
Apply calculation.

We can't unfortunately do the job for you.

If you then have specific question on how to use a Focus function per example, we'll then be glad to help you.


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Platinum Member
posted Hide Post
As MartinY has pointed out, you seem to have the logic and rules figured out. From there it's going to be trial and error using date functions to try and come up with your solution, here's a link to some helpful date/time tips: https://www.informationbuilder...elopers/AllAboutDate. Using that, the help docs, and searching this forum you should be able to get something going.

Me personally I would rather create a function in the database (in our case SQL Server) that would do this sort of calculation and pass that calculated value to WF.

Good luck!


JC
WebFOCUS Dev Studio / App Studio
8.2.01
Windows 7
 
Posts: 146 | Registered: November 09, 2015Report 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] Calculate Business Hrs Between 2 Dates (8 am -5 pm -Exclude Wkends/Holidays)

Copyright © 1996-2020 Information Builders