Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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) | Value | weighted | final | Correct Hrs |
77000 | 11:29:07 | 79:46:39 | |||
0:22:30 | 0:22:30 | 30000 | 9:21:02 | 0:08:46 | 0.0060877 |
23:05:30 | 23:05:30 | 20000 | 6:14:02 | 5:59:52 | 0.2499098 |
333:45:42 | 21:35:42 | 15000 | 4:40:31 | 4:12:25 | 2.7091044 |
55:16:46 | 7:16:46 | 12000 | 3:44:25 | 1:08:04 | 0.3589574 |
NetWorkDays function skips weekends by default, look for some other alternative.