CHAPTER 9 Filtering, Sorting, and Grouping Rows
DataWindow Designer User’s Guide 277
Creating subgroups
After defining your first group, you can define subgroups, which are groups
within the group you just defined.
❖ To define subgroups:
1 Select Rows>Create Group from the menu bar and specify the
column/expression for the subgroup.
2 Repeat step 1 to define additional subgroups if you want.
You can specify as many levels of grouping as you need.
How groups are
identified
DataWindow Designer assigns each group a number (or level) when you create
the group. The first group you specify becomes group 1, the primary group.
The second group becomes group 2, a subgroup within group 1, and so on.
For example, suppose you define two groups. The first group uses the
dept_id
column and the second group uses the
status column.
The rows are grouped first by department (group 1). Within department, rows
are grouped by status (group 2). If you specify page breaks for the groups, a
page break will occur when any of these values changes.
You use the group's number to identify it when defining summary statistics for
the group. This is described in “Adding summary statistics” on page 279.
Sorting the rows
DataWindow Designer does not sort the data when it creates a group.
Therefore, if the data source is not sorted, you must sort the data by the same
columns (or expressions) specified for the groups.
For example, if you are grouping by
dept_id then status, select Rows>Sort from
the menu bar and specify
dept_id and then status as sorting columns: