I have a universe that gives me [date] and [time] of event in two separate details… & yes I would like them together in one for obvious reasons - but I’m not going to get that immediately.
I need to calculate the time difference between X & Y. I can create a variable that gives me :
=([Job Event Date]+" "+[Job Event Time]) Where ([Job Event]=“ENTERED”) In ([Job ID])
and
=([Job Event Date]+" "+[Job Event Time]) Where ([Job Event]=“PRACTICALLY COMPLETE”) In ([Job ID])
Those are my two variables that get me start and end dates of my jobs. There are multiple [Job Events] per job hence the In [Job ID] where clause so I just one instance per row in a simple table of job id, start and end date.
I’ve come stuck, becasue XI isn’t treating my variables as dates. I’ve tried wrapping them in a todate() statement but that just brings up errors.
Any ideas (other than universe development of creating two seemingly standard variables giving me what I need immediately.)?
Also, once I’ve got my date & times sorted - how would you go about calculating the time difference between them in BO? Can it do [end]-[start] to give me a numeric value as I’d do in Excel?
Sometimes on a Friday I get blond moments! The reason that I couldn’t wrap my statements in the todate() function to get BO to treat them as dates & times was that our universes time variable only returns hh:mm not hh:mm:ss…
I tried this when I got in this morning:
=ToDate(([Job Event Date]+" “+[Job Event Time]+”:00") Where ([Job Event]=“ENTERED”) In ([Job ID]);“dd/mm/yyyy HH:mm:ss”)
and it works fine. I do still have an issue because webi XI doesn’t seem to have a datediff function because I want to get to the number of seconds between my start and end dates but I’m closing this topic now, and am going to have a search on the forum before posting a question about that - I may not need it if the resource is here already. I have done this previously in deski by converting the date to a number and I forgot to bring that stuff in with me today!
For anyone interested - or that stumbles on this topic. The answer lies here courtesy of Marek Chladny
The formulas there in the topic are for DeskI so you will need to modify them for WebI because WebI has slightly different syntax of some functions. Since this is the Webi forum here are the Webi versions to give you: