Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculate hrs and mins

Data set is given below:

Close Datetime                 Start Datetime                  Total HH:MM   Req HH:MM

6/23/2011   8:46:34 AM     5/22/2011 6:48:11 PM       757.97              176.00

7/25/2011 11:16:45 AM     5/23/2011 8:07:36 AM      1515.15              362.27

12/26/2011 7:48:56 PM     5/23/2011 9:30:55 AM      5218.30              1247.50

Requriment result is in Red

Condition is hh:mm calculate base 9:00am to 5:00pm working hrs and min,

not includes saturday, sunday and other hrs and min.

for example: 5/21/2012 4:00pm is start time and 5/22/2012 10:00am is close time, so result is 2:00hrs.

5/21/2012 3:45pm is start time and 5/22/2012 10:30am is close time, so result is 2:45hrs.

5/18/2012 3:00pm is start time and 5/21/2012 11:00am is close time, so result is 4:00hrs. not used sat & sun

Labels (1)
11 Replies
Not applicable
Author

Thanks Sjcharies,

your solution is working fine,

now i am working on holidays within working days, for example  1st May 2012 or festivel holidays etc. i have year holidays list and i am trying to Incorporate in your script, if you have idea regarding this please share with me.

Regards,

Zain.

Not applicable
Author

The syntax for networkdays is:

networkdays(

start_date, end_date {, holiday} )

Note that you cna add the holiday dates after the start date and the end date. You can add as many holiday dates as you need. So you would have to modify my script where every the is a networkdays statement

For example:

NetWorkDays

(StartDateTime,CloseDateTime,'5/1/2012'

)

Stephen