4 Replies Latest reply on Sep 27, 2018 8:13 PM by meenu choudhary

    Translation from Oracle to Tableau formula

    Mel Buckner

      I have two datetimes - order_time and result_time I need to convert them to numbers so I can subtract one from the other to get the length of time between them (that the lab result took to come back)


      this is how I did it in Webi driving by Oracle:


      =DaysBetween([Order_Time];[Result_Time]) * 1440 + ( ToNumber(FormatDate([Result_Time] ;"HH")) * 60 + ToNumber(Left(FormatDate([Result_Time] ;"mm:ss") ;2))) - (ToNumber(FormatDate([Order_Time] ;"HH")) * 60 + ToNumber(Left(FormatDate([Order_Time] ;"mm:ss") ;2)))


      I am pretty sure it's much simpler syntax in tableau calculated field but it seems to be so simple that no matter what I try I can't figure it out - so wondering if anyone can help.  I've tried converting each to int() but that came back with a super wierd number that made no sense - so there is obviously more to it than that.  thanks.