Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Consolidating table rows on some conditions(consolidating table rows on some conditions)
Consolidating table rows on some conditions [message #916545] Wed, 19 September 2012 02:30 Go to next message
Marina Orth is currently offline Marina Orth
Messages: 36
Registered: September 2012
Member
Hi,

i'm using BIRT to manage tables with datasets. Now i have following problem: For example my dataset is consisting of four columns name, payment, date and store. In my table it looks like this:

name payment date store
Thorsten 3,9 01.01.2012 ebay
Thorste 2,3 03.04.2012 ebay
Michael 4,7 03.05.2012 ebay
Michael 3,8 06.06.2012 amazon

Now i want to consolidate the columns that way:

if name[i]== name[j] and store[i]==store[j] then
payment[i]= payment[i]+payment[j];
date[i]= max(date[i],date[j]);
delete(row[j]))

If there are three or more columns with same store and name, then there will be three or more columns consolidated in one. My table should look like this:

name payment date store
Thorsten 6,2 03.04.2012 ebay
Michael 4,7 03.05.2012 ebay
Michael 3,8 06.06.2012 amazon



Is there any way for working with filters or aggregations? Or is it better to work with javascript on onCreate? Unfortunally I'm not so good in javascript...

Greetings Marina
Re: Consolidating table rows on some conditions [message #916948 is a reply to message #916545] Wed, 19 September 2012 13:12 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

You can do this with a table and two groups. Just hide the detail rows. Or use a data cube. In the attached example, I created a scripted data set to use your sample data. It shows a crosstab tied to a cube that aggregates your values, and a table tied directly to the table with two nested groups.

Jason
Re: Consolidating table rows on some conditions [message #917505 is a reply to message #916948] Thu, 20 September 2012 02:30 Go to previous message
Marina Orth is currently offline Marina Orth
Messages: 36
Registered: September 2012
Member
Hello Jason,

THANKS!

It works right the way i want it. I'm using the table with two groups. Not the crosstab.

Bye Marina
Previous Topic:switch from 2.3.0 to 2.3.1, "Processing please wait" never ends in jboss birt runtime
Next Topic:Questions about conditions depending values etc..
Goto Forum:
  


Current Time: Sat Jul 26 03:08:37 EDT 2014

Powered by FUDForum. Page generated in 0.01612 seconds