Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
tellmalaika17
Contributor II
Contributor II

Working hours field not getting evaluated

I have added below script in the backend and naming it as WorkingHours...This is excluding weekend and calculating hours accordingly.

nterval(
rangesum(
NetWorkDays(DT1+1,DT2-1) * 1
,
if(NetWorkDays(DT1,DT11-frac(DT1),0)
,if(NetWorkDays(DT2,DT2), frac(DT2),0)
,
if(NetWorkDays(DT1,DT1) and floor(DT1)=floor(DT2),-1 ) )))as 'WorkingHours',

Works well for some dates. Working hours col has been taken as dim just to present the correct nos. These nos should reflect in working hours(expression) column ideally. Using ='WorkingHours' on the straight table as an expression. See below : Would really appreciate, if someone can help me out get the nos correct. Thanks

   

Working Hours (dimension)Working Hours(expression)Valueweighted final Correct Hrs
77000 11:29:0779:46:39
0:22:300:22:30300009:21:020:08:460.0060877
23:05:3023:05:30200006:14:025:59:520.2499098
333:45:4221:35:42150004:40:314:12:252.7091044
55:16:467:16:46120003:44:251:08:04

0.3589574

1 Reply
prabhu0505
Specialist
Specialist

NetWorkDays  function skips weekends by default, look for some other alternative.