Hi guys,
Before I begin, I would like to thank you all for this forum as it is the best resource available for troubleshooting and advising on BOXI!
My query revolves around a variable object I created within a report that subtracts 2 dates and formats the result into the time format the user wants.
I was stuck on this too (I have only been using BOXI for 6 months and being trained ‘on the job’), but you guys came to the rescue with the formula I needed (credits calculate difference between two times in webi and Subtracting Dates, thank you @mikca and @Listserv Archives!). The variable formula is like below. Its rather long and can probably be tidied up itself:
=If IsNull(
(
(
(
ToNumber( Substr( FormatDate([Vetted DateTime (Date & Time)] ;"HH:mm:ss" ) ; 1 ; 2 ) ) * 60 * 60 +
ToNumber( Substr( FormatDate([Vetted DateTime (Date & Time)] ;"HH:mm:ss" ) ; 4 ; 2 ) ) * 60 +
ToNumber( Substr( FormatDate([Vetted DateTime (Date & Time)] ; "HH:mm:ss" ); 7 ; 2 ) ) )
-
(
ToNumber( Substr( FormatDate([Result DateTime (Date & Time)] ; "HH:mm:ss" ) ; 1 ; 2 ) ) * 60 * 60 +
ToNumber( Substr( FormatDate([Result DateTime (Date & Time)] ; "HH:mm:ss" ) ; 4 ; 2) ) * 60 +
ToNumber( Substr( FormatDate([Result DateTime (Date & Time)] ; "HH:mm:ss" ) ; 7 ; 2 ) ) )
)
) / 60 + (DaysBetween([Result DateTime (Date & Time)] ; [Vetted DateTime (Date & Time)]) *24 * 60 )) Then "00:00:00" Else FormatNumber((Floor(Truncate(Mod(
(
(
(
ToNumber( Substr( FormatDate([Vetted DateTime (Date & Time)] ;"HH:mm:ss" ) ; 1 ; 2 ) ) * 60 * 60 +
ToNumber( Substr( FormatDate([Vetted DateTime (Date & Time)] ;"HH:mm:ss" ) ; 4 ; 2 ) ) * 60 +
ToNumber( Substr( FormatDate([Vetted DateTime (Date & Time)] ; "HH:mm:ss" ); 7 ; 2 ) ) )
-
(
ToNumber( Substr( FormatDate([Result DateTime (Date & Time)] ; "HH:mm:ss" ) ; 1 ; 2 ) ) * 60 * 60 +
ToNumber( Substr( FormatDate([Result DateTime (Date & Time)] ; "HH:mm:ss" ) ; 4 ; 2) ) * 60 +
ToNumber( Substr( FormatDate([Result DateTime (Date & Time)] ; "HH:mm:ss" ) ; 7 ; 2 ) ) )
)
) / 60 + (DaysBetween([Result DateTime (Date & Time)] ; [Vetted DateTime (Date & Time)]) *24 * 60 ) ; 3600) ; 0) / 60) )
;"00")+":"+FormatNumber(Floor(Mod(Mod(
(
(
(
ToNumber( Substr( FormatDate([Vetted DateTime (Date & Time)] ;"HH:mm:ss" ) ; 1 ; 2 ) ) * 60 * 60 +
ToNumber( Substr( FormatDate([Vetted DateTime (Date & Time)] ;"HH:mm:ss" ) ; 4 ; 2 ) ) * 60 +
ToNumber( Substr( FormatDate([Vetted DateTime (Date & Time)] ; "HH:mm:ss" ); 7 ; 2 ) ) )
-
(
ToNumber( Substr( FormatDate([Result DateTime (Date & Time)] ; "HH:mm:ss" ) ; 1 ; 2 ) ) * 60 * 60 +
ToNumber( Substr( FormatDate([Result DateTime (Date & Time)] ; "HH:mm:ss" ) ; 4 ; 2) ) * 60 +
ToNumber( Substr( FormatDate([Result DateTime (Date & Time)] ; "HH:mm:ss" ) ; 7 ; 2 ) ) )
)
) / 60 + (DaysBetween([Result DateTime (Date & Time)] ; [Vetted DateTime (Date & Time)]) *24 * 60 ) ; 3600) ; 60) ) ;"00")
Rather than having this available on the one report, the user would like it available at universe level, and I thought it might be (almost) as easy as copy and paste, but no such luck.
Can anyone help guide me on how to create this as an object at universe level, or if it is even possible at all?
Many Thanks
TheOriginal (BOB member since 2015-05-01)