Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » How to calculate SUM cumulative times type of string?(How to calculate SUM cumulative times type of string in format HH:mm:ss)
How to calculate SUM cumulative times type of string? [message #768509] Tue, 20 December 2011 09:34 Go to next message
Dejan Vujanic is currently offline Dejan VujanicFriend
Messages: 67
Registered: October 2011
Member
index.php/fa/6503/0/
I have cumulative times in format HH:mm:ss and they display how much time did some record been in specific status. In database they are all STRING values.
How to calculate SUM of that times? should I use some sql expression or some BIRT function for this?
This is the example with statuses.
For this example I must exclude from result statuses CLOSED and ADDINFNDD.
So the final result should be : 00:01:59+00:00:05+34:20:58+00:00:07 = 34:23:09

Thanks for help!!

[Updated on: Tue, 20 December 2011 09:45]

Report message to a moderator

Re: How to calculate SUM cumulative times type of string? [message #768729 is a reply to message #768509] Tue, 20 December 2011 17:03 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Take a look at this example:

http://www.birt-exchange.org/org/devshare/designing-birt-reports/1450-time-string-sum/

I would just use a dataset filter to remove the sums you do not want.

Jason

On 12/20/2011 4:34 AM, cankovicv wrote:
>
> I have cumulative times in format HH:mm:ss and they display how much time did some record been in specific status. In database it is all STRING values.
> How to calculate SUM of that times? should I use some sql expression or some BIRT function for this?
> This is the example with statuses.
> For this example I must exclude from result statuses CLOSED and ADDINFNDD.
> So the final result should be : 00:01:59+00:00:05+34:20:58+00:00:07 = 34:23:09
>
> Thanks for help!!
>
Re: How to calculate SUM cumulative times type of string? [message #769233 is a reply to message #768729] Wed, 21 December 2011 16:10 Go to previous messageGo to next message
Dejan Vujanic is currently offline Dejan VujanicFriend
Messages: 67
Registered: October 2011
Member
Thank you Jason you are legend!!!

Can I ask you one more question which is not so related with this topic?

I use parameter in some data set which asks for the name of the COMPANY and result is some graphic (not list table result).
When I use only one company graphic is correct.

But when I use % for displaying all companies the result is blank graphic. Does this cant be done through the parameters - for graphic results?

Parameter is defined as required and string text box, and data set is calling parameter COMPANY like ?

index.php/fa/6524/0/
Thanks again
  • Attachment: parameter.jpg
    (Size: 46.55KB, Downloaded 2128 times)
Re: How to calculate SUM cumulative times type of string? [message #769764 is a reply to message #769233] Thu, 22 December 2011 16:38 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Can you post the report? You may want to add a table for testing to see
if the dataset is returning values. I am attaching an example that
uses a like query.

Jason

On 12/21/2011 11:10 AM, cankovicv wrote:
> Thank you Jason you are legend!!!
>
> Can I ask you one more question which is not so related with this topic?
>
> I use parameter in some data set which asks for the name of the COMPANY and result is some graphic (not list table result).
> When I use only one company graphic is correct.
>
> But when I use % for displaying all companies the result is blank graphic. Does this cant be done through the parameters - for graphic results?
>
> Parameter is defined as required and string text box, and data set is calling parameter COMPANY like ?
>
>
> Thanks again
Re: How to calculate SUM cumulative times type of string? [message #772693 is a reply to message #768509] Fri, 30 December 2011 11:23 Go to previous messageGo to next message
Dejan Vujanic is currently offline Dejan VujanicFriend
Messages: 67
Registered: October 2011
Member
Hi Jason,

sorry I can not open your example. Here is my report if you can find the problem. When I use ? to select all companies I am getting blank result.
I think that data set is OK in general, probably it is the problem with like query.

Thanks for help

[Updated on: Fri, 30 December 2011 11:24]

Report message to a moderator

Re: How to calculate SUM cumulative times type of string? [message #774248 is a reply to message #772693] Tue, 03 January 2012 15:28 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

I did not see any like clauses in your query. In my example I use:
select *
from products
where productname like ?

You may also want to verify that you have the string quoted like:

select *
from products where productcode like'%'

Jason

On 12/30/2011 6:23 AM, cankovicv wrote:
> Hi Jason,
>
> sorry I can not open your example. Here is my report if you can find the problem. When I use ? to select all companies I am getting blank result.
> I think that data set is OK in general, probably it is the problem with like query.
>
> Thanks for help
>
Previous Topic:Column sum based on another column
Next Topic:MySQL JDBC Driver 5.5 troubleshooting
Goto Forum:
  


Current Time: Thu Apr 18 11:01:36 GMT 2024

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

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

Back to the top