In this example we will show how to make a simple report using grouping and summation. Therefore we use a simple table with 2 columns only. The table looks like this:
groupcolumn | sumcolumn |
---|---|
A | 12 |
A | 23 |
B | 15 |
B | 21 |
B | 24 |
C | 11 |
C | 17 |
C | 44 |
What we want to do is to group the data on the column groupcolumn and sum the values in column sumcolumn for each group. The expected result should look like this.
groupcolumn | sumcolumn |
---|---|
A | 35 |
B | 60 |
C | 72 |
First we create a report without a database connection. After we have done this our field browser does contain our two columns now.
Now we group the data in the first column. Therefore we add a group using the group dialog.
After this we will add a sum.
Now we just have to add the fields to the editor page. Simply drag group #1 and the sum mysum into the Group Footer area.
As a result you'll get the sum for every group: