Consolidating table rows on some conditions [message #916545] |
Wed, 19 September 2012 06:30  |
Marina Orth Messages: 51 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 17:12   |
|
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
|
|
|
|
Powered by
FUDForum. Page generated in 0.01978 seconds