Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Time interval between two timestamps but except closed hours

Hi I need some help with Time interval between two timestamps. The function give me the interval without any problem

Sum ([SLA Resolution Time]-interval([Resolve Date]-[Open Date],'hh:mm:ss'))

But my problem start when working hour is 0700 - 1800 so is there any easy solution so the time between 18;00;01 and 06;59;59 will not be counted in above function?

Thanks in advance

5 Replies
fosuzuki
Partner - Specialist III
Partner - Specialist III

Hi Banjir,

could you give an example? Or even better send a sample QVW?

Regards,

Fernando

nagaiank
Specialist III
Specialist III

Hi,

You may take the numerical difference between the two timestamps. Multiply integer part by 11 and fractional part by 24 to get the hours. This assumes that both the timestamps are in the 7:00 - 18:00 window of time. The attached qvw file shows this simple implementation.

If you have to take into account the non-working hours of holidays and weekends, and if you have to check if the timestamps fall in the working hours, some additional development is needed.

Hope this helps.

Not applicable
Author

Hi Banjir1848,

I am also facing this problem.

Can share any sample application realted to this SLA calaculation.

Tthanks,

Not applicable
Author

As posted in my own subject;

I have managed to solve the issue, based on an excel example on this site http://chandoo.org/wp/2010/09/10/working-hours-formula/.

The sollution is as follows:

//$1 WorkDayStart. Format 9, 9.5, 21
//$2 WorkDayEnd.Format 9, 9.5, 21
//$3 TimeStampStart. Format DateTime
//$4 TimeStampEnd. Format DateTime

Set fxCalcWorkHours = (($2-$1)*NetWorkDays($3,$4))  -(24*(  FMOD($3,1)  -($1/24)  +($2/24)  -FMOD($4,1) ));

So you can load it into a table with the command:


Load *,

$(fxCalcWorkHours(9,18,StartDateTime, EndDateTime) as WorkHoursSpent;

Cheers, Mark

Not applicable
Author

Hi Mark,

Can you help me here, i have used your calculation which works great. however some start dates are at weekends, i want to be able to say if the start date is say on a sunday start the calculation at 8am monday to the close date?

can this be done?

thanks

laura