Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » How to calculate elapsed time?
How to calculate elapsed time? [message #1059000] Thu, 16 May 2013 03:41 Go to next message
sonam mantri is currently offline sonam mantri
Messages: 4
Registered: May 2013
Junior Member
I have tickets with submit date and closed date.
I wish to calculate the total time elapsed between submission and closure of the ticket.
The entries in those columns are in following format:
May 10, 2013 6:15 PM

Also some tickets are not closed so there entries are blank. Also let me know how to calculate for the same.

i want the elapsed time column to appear as a separate column in report.

please help...
and thanks in advance...
Re: How to calculate elapsed time? [message #1059143 is a reply to message #1059000] Thu, 16 May 2013 20:42 Go to previous messageGo to next message
Michael Williams is currently offline Michael Williams
Messages: 828
Registered: July 2009
Senior Member

You should be able to create a computed column and use this function to get the seconds between your two dates:

BirtDateTime.diffSecond(date1,date2)

From there, you can use the elapsed seconds value to display what you'd like.


Regards,

Michael Williams
BIRT Exchange
Michael's BIRT Blog
Re: How to calculate elapsed time? [message #1059164 is a reply to message #1059143] Fri, 17 May 2013 01:15 Go to previous messageGo to next message
sonam mantri is currently offline sonam mantri
Messages: 4
Registered: May 2013
Junior Member
thank you...

can i calculate the time in HH:MM format..as in exact hours and mins...??
Re: How to calculate elapsed time? [message #1059165 is a reply to message #1059164] Fri, 17 May 2013 02:05 Go to previous message
Michael Williams is currently offline Michael Williams
Messages: 828
Registered: July 2009
Senior Member

If you took the seconds from above, you could easily create this format with something like the following as your expression for you type string computed column:

remainingSeconds = BirtDateTime.diffSecond(date1,date2);

Hours = Math.floor(remainingSeconds/3600);
remainingSeconds = remainingSeconds%3600;
Minutes = Math.floor(remainingSeconds/60);
remainingSeconds = remainingSeconds%60;

colOutput = Hours + ":" + Minutes + ":" + remainingSeconds;
colOutput;


Regards,

Michael Williams
BIRT Exchange
Michael's BIRT Blog
Previous Topic:BIRT ignores alias when generating column binding names for joint data sets
Next Topic:Google AdWords/Analytics Data Source
Goto Forum:
  


Current Time: Tue May 28 22:34:03 EDT 2013

Powered by FUDForum. Page generated in 0.01549 seconds