Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Agregations and grouping between Data Sets
Agregations and grouping between Data Sets [message #671036] Mon, 16 May 2011 15:34 Go to next message
gin1975  is currently offline gin1975 Friend
Messages: 30
Registered: April 2011
Member
I need to do the following from a series of Data Set in a report. I put a simple example for you to try to orient myself, if possible, about the possibilities of Birt to do this:

1. Data Set1: This dataset obtained a number of items and the associated product. Example:
item 1 - product1
item 2 - product2
item 3 - product2
Then I add the report a table, doing data binding to this table and have calculated the total number of items for the project through an aggregation (count(total_items)) and a product grouping (by group). Example of results showed in this report:
total_items product1 = 1
total_items product2 = 2

2. Data Set2: DataSet Similar to the above, I added a table, doing data binding and grouped by product obtaining the following results. Example:
total_item_solds product1 = 1
total_item_solds product2 = 1

3. Next, I need to calculate in another table the following percentages:
percentage of items sold product1 = (1 / 1) * 100
percentage of items sold product2 = (1 / 2) * 100


The problem is that I see no way to calculate this percentage from the results of 1 and 2. Is there any way to create a table and associate multiple dataset to create aggregations and groupings among them? If not possible, what way can solve this problem?

Thanks
Re: Agregations and grouping between Data Sets [message #671061 is a reply to message #671036] Mon, 16 May 2011 16:06 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

A crosstab that uses multiple datasets may be better in this case but
you can use scripting for the onCreate script on the aggregration
element to store the value from one table and use it in the expression
of a data item in a later table. Take a look at this example.

http://www.birt-exchange.org/org/devshare/designing-birt-rep orts/1364-agggregating-across-two-tables/

Jason

On 5/16/2011 11:34 AM, gin1975 wrote:
> I need to do the following from a series of Data Set in a
> report. I put a simple example for you to try to orient
> myself, if possible, about the possibilities of Birt to do
> this:
>
> 1. Data Set1: This dataset obtained a number of items and
> the associated product. Example:
> item 1 - product1
> item 2 - product2
> item 3 - product2
> Then I add the report a table, doing data binding to this
> table and have calculated the total number of items for the
> project through an aggregation (count(total_items)) and a
> product grouping (by group). Example of results showed in
> this report:
> total_items product1 = 1
> total_items product2 = 2
>
> 2. Data Set2: DataSet Similar to the above, I added a table,
> doing data binding and grouped by product obtaining the
> following results. Example:
> total_item_solds product1 = 1
> total_item_solds product2 = 1
>
> 3. Next, I need to calculate in another table the following
> percentages:
> percentage of items sold product1 = (1 / 1) * 100
> percentage of items sold product2 = (1 / 2) * 100
>
>
> The problem is that I see no way to calculate this
> percentage from the results of 1 and 2. Is there any way to
> create a table and associate multiple dataset to create
> aggregations and groupings among them? If not possible,
> what way can solve this problem?
>
> Thanks
>
Previous Topic:how to use rptlibrary in resource folder
Next Topic:data source
Goto Forum:
  


Current Time: Thu Nov 27 20:10:08 GMT 2014

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

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