Grouping rows

You can group related rows together and, optionally, calculate statistics for each group separately. For example, you might want to group employee information by department and get total salaries for each department.

How groups are defined

Each group is defined by one or more DataWindow object columns. Each time the value in a grouping column changes, a break occurs and a new section begins.

For each group, you can:

Grouping example

The following DataWindow object retrieves employee information. It has one group defined, Dept_ID, so it groups rows into sections according to the value in the Dept_ID column. In addition, it displays:

The following screenshot shows the DataWindow object.

The sample is titled Total Compensation Report Salary Plus Benefits. At left is the Dept I D column. All other data is grouped by department I D in columns to the right that  include employee names and salaries, check boxes for Health and Life Insurance and Day Care, and a column for salary plus benefits. At the end of the rows for each department’s data are totals and averages for Salary and Salary Plus Benefits.

How to do it

You can create a grouped DataWindow object in two ways: