Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » How to calculate elapsed time?
How to calculate elapsed time? [message #1059000] Thu, 16 May 2013 07:41 Go to next message
sonam mantri is currently offline sonam mantriFriend
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] Fri, 17 May 2013 00:42 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
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.


Michael

Developer Evangelist, Silanis
Re: How to calculate elapsed time? [message #1059164 is a reply to message #1059143] Fri, 17 May 2013 05:15 Go to previous messageGo to next message
sonam mantri is currently offline sonam mantriFriend
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 06:05 Go to previous message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
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;


Michael

Developer Evangelist, Silanis
Previous Topic:BIRT ignores alias when generating column binding names for joint data sets
Next Topic:custom format x-axis and y-axis label in chart by script
Goto Forum:
  


Current Time: Fri Apr 26 22:27:35 GMT 2024

Powered by FUDForum. Page generated in 0.03646 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top