BusinessObjects Board

Date manipulation

I need to know how to work out the processing time of a transaction, given its start date and completion date. Can anyone please help?


bob-brewer :uk: (BOB member since 2006-02-28)

Assuming you are using a compatible BO version (e.g. 6.5.1), and that you want elapsed time between two dates in hours, try the following:

  1. Create a new variable. On the Definition tab call it Date1 and on the Formula tab select the object you want as the earlier date
  2. Create another new variable. On the Definition tab call it Date2 and on the Formula tab select the object you want as the later date
  3. Create a final new variable, then copy and paste the following into the Formula tab
    =((DaysBetween( ,)2460*60 +
    ToNumber(FormatDate( ,“HH”))6060 +
    ToNumber(SubStr(FormatDate( ,“mm:ss”) ,1 ,2))*60 +
    ToNumber(FormatDate( ,“ss”)))

(ToNumber(FormatDate( ,“HH”))6060 +
ToNumber(SubStr(FormatDate( ,“mm:ss”) ,1 ,2))*60 +
ToNumber(FormatDate( ,“ss”)))) / 3600

Providing you have named the first two Date1 and Date2 then this formula should work without any further editing. You can change the dates that the formula works on just by changing the Date1 and Date2 variables. If you prefer seconds instead of hours you can adjust the formula accordingly.

Regards

Beck


beckster :uk: (BOB member since 2003-02-18)

Just calculate the difference between start and end time. How that’s done depends wether you want to do it in reporter or on the DB, if the latter it depends on what DB you’re on, what datefields you have.

If you want to do it on reporter level then look at https://bobj-board.org/t/21735


jobjoris :netherlands: (BOB member since 2004-06-30)