Home
Analytics
Grouping and Aggregating in BIRT 4.5
Istabrak
<p>Greetings to all,</p>
<p>I am using BIRT4.5 bundled with Eclipse.</p>
<p>The input file is csv-formatted with the first column as the index and the other columns have float values.</p>
<p>I need to make a report to display:</p>
<p>- The same col header names as the input file</p>
<p>- The index and the runningSum for the other indexes every 10 rows.</p>
<p>There should be no other rows in the report.</p>
<p> </p>
<p>In other words, the required output is all follows:</p>
<p>Index Hdr First Col Header Nth Col Header</p>
<p> </p>
<p>10th row Index ---- runSum of the first 10rows of col-1 .......runningSum of the first 10 rows of col-N</p>
<p>20th row Index ---- runSum of the second 10rows of col-1.....runningSum of the second 10 rows of col-N</p>
<p>...........</p>
<p>..........</p>
<p>and so on.</p>
<p> </p>
<p>Could you please provide some guidance as I am relatively new to BIRT?</p>
<p> </p>
<p>Thx</p>
Find more posts tagged with
Comments
micajblock
<p>Can you provide a sample CSV?</p>
Istabrak
<p>Hi Mica,</p>
<p>Thx for the follow up.</p>
<p>Here is a sample input and the desired sample output.</p>
<p> </p>
<p>Best regards,</p>
<p> </p>
<p> </p>
<p> </p>
<p>
jfranken
<p>See if the attached report works for you. Change the data source to point to your csv file.</p>
<p> </p>
<p>I created two computed fields in the data set. The running count field is used in the second computation. The second field counts up 1 every 10 rows. You can group on it and then use the aggregation element to display group sums for the columns. Then just turn off the visibility of the rows and columns that aren't needed.</p>
Istabrak
<p>Hi Jeff,</p>
<p>Thx a lot for the info.</p>
<p>It works..:-).</p>
<p> </p>
<p>I have a couple of more questions:</p>
<p>1. Does the grouping of data get triggered each time the count is incremented by 1 (in our case via the group10 computed col)?</p>
<p>2. What other conditions are needed to trigger the grouping e.g. if we are using a range of values rather than the number of rows?</p>
<p>3. When I did the aggregation first time, I was getting all the table details data plus the aggregation ones.</p>
<p> Then I selected the "Hide Detail" button on the Aggregation Edit window and that took care of hiding the details.</p>
<p> For the other columns (e.g. runCount and the group10) I set the visibility property to "Hide" to prevent them from showing up.</p>
<p> Is this the right way to hide them or is there a more efficient way of hiding the unneeded headers and column values?</p>
<p> </p>
<p>Best Regards,</p>
jfranken
<p>1. A group is created for each unique value in the column being grouped on. So in the sample report that groups on the column named "group10", every different value in that column will generate a new group and all rows that share that value in that column will be placed in the same group.</p>
<p>2. An exception to the first answer is grouping on a range of values. If you select the table, click the Group tab, and create a new group, you'll see an option in the Group edit window called "Interval". There are some built-in options for grouping on date ranges. You can also choose "Interval" from the dropdown and enter a number in the box. The Interval property lets you create groups for ranges of values instead of one specific value.</p>
<p>3. Turning the visibility off is a good way to hide elements when the report runs. It can sometimes be confusing when, say a column doesn't appear on the report and you don't know why unless you notice the visibility check box. Another option is to delete the rows and columns you don't want to appear in the output. The data bindings still exist so the report will run as planned. That method might be a little less intuitive because you don't see how values are being generated when looking at the report layout.</p>
<p> </p>
<p>I hope this answers your questions,</p>
<p>Jeff</p>