1 Reply Latest reply: Jun 14, 2016 11:51 AM by Saravana Prabhu Paramaramaraj RSS

    Working hours field not getting evaluated

    Malaika S

      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