Grouping Data

Posted on 12/11/2023

grouping
beginner
organization

Benefits of Grouping Data

Sorting data is only one way to organize data in a report. But, in report development, it is common to present data that is organized into meaningful groups, especially reports with a large number of columns. With groups, you can:

  • Add aggregations Aggregations to summarize data within each group.
  • Insert page breaks before or after each group to start each group of data on a new page.
  • Hide the details of each group to view a summary report Creating Summary Tables.

Upon creating a group, BIRT Studio performs the following:

  • Removes duplicate values
  • Sorts the values of each group (though this can be changed - Sorting Data)

How to Create a Group

Creating groups is very easy to do in BIRT Studio. To create a group, select a column and click the group icon in the table toolbar. This will create a group with the selected column as the group key. You can also right-click on a column and select Group > Add Group from the context menu. Multiple groups can be created by performing the same steps on other columns.

To remove a group, select the column and click the “Delete Group” icon (it will look like and be in the same position on the table toolbar as the “Add Group” icon but will have an “X” in the bottom right corner of the icon). You can also right-click on the group header and select Group > Delete Group from the context menu.

Grouping on Date and Time Columns

When grouping on date and time columns, BIRT Studio will present two options:

  • Group using individual values
  • Group every X time units

Grouping using individual values will group the data by the individual values in the column. For example, if you have a datetime column that has the value Dec 22, 2023 7:30 AM, then the group will be Dec 22, 2023 7:30 AM. This is not usually the most useful and you will more often than not want to group using the second option.

Grouping every X time units will group the data by the time unit you select. For example, using the same values as above, then the group will be Dec 22, 2023. This is much more useful in most cases.

The values that are available for the time units are:

  • Years
  • Quarters
  • Months
  • Weeks
  • Days
  • Hours
  • Minutes
  • Seconds

Changing the Order of Groups

Groups can be reordered by right clicking on a grouped column and selecting Column > Reorder Columns. Groups can be reordered by clicking the up and down arrows in the Grouped Columns section.

Creating Sections

A section is functionally equivalent to a group. When you create a section, you are also grouping data. Similar to groups, you can create multiple sections, calculate aggregate data for each section, start each section on a new page, and hide the details of each section.

However, one of the differences between a section and a group is how the information is arranged. See the below images for an example of a group and a section.

To create a section in an existing report, select the columns that you want to be added as a section by left clicking on the first column and Ctrl clicking on any other column. Right click and select Group > Add Section. This will add the columns as sections.