BusinessObjects Board

Date/Time Difference?

I want to be able to take the Current Date/time, i don’t know how you derive that. I see a function for Currentdate() and currenttime(), do you just concatenate? And subtract it from a date/time dimension i have to get the difference, but display the difference in this format “#d #h #m”.

I can’t figure out how to do this properly. Has anyone tackled this before?

The d is days, the h is hours, and the m is minutes.

LittleMalky (BOB member since 2012-03-20)

This is a common subject. Here is a topic that discusses how to do this in Web Intelligence:

I usually use the =LastExecutionDate() instead of the CurrentDate() or Time functions. This way, the report will not change values until it is refreshed again.

If possible, it is better to create a universe object that tracks the difference between two dates.

Wlog (BOB member since 2012-07-26)

the function help will tell you what data types the function takes as parameter(s), what data type is returned from the function, and basically what it does inside the logic.

when dealing with dates in webI, you need to know what data type the objects are, which you want to use in your function.

if you look under the data functions there is one for getting the difference in days between two dates, which takes date data types as parameters. however, sometimes you would be working with a “date” field, which is actually in a string object. in this case you would need to use another function to convert it first. lastexecutiondate() function returns a string data type, so if you wanted to use it in a function to get difference in days you’d first need to use todate() to convert the string to a date.

i think the current date function also returns a date.

if you’re just trying to get a duration based on data from your source system, sometimes it is true that you would want to create another object in the universe or database to return a duration for your reporting purposes, rather than calculating it within webI

erik.stenson :us: (BOB member since 2012-07-30)