Specifications

CHAPTER 5 Defining Reports
Users Guide 179
To define GROUP BY criteria:
1 Click the Group tab to make the Group view available (or select
View>Group if the Group view is not currently displayed).
The columns in the tables you selected display in the left side of the Group
view. You might need to scroll to see your selections.
2 Drag the first column you want to group onto the right side of the Group
view.
This specifies the column for grouping. Columns are grouped in the order
in which they are displayed in the right side of the Group view.
3 Continue to specify additional columns for grouping within the first
grouping column as needed.
To change the grouping order, drag the column names in the right side to
the positions you want.
4 Define sorting (Sort view), limiting (Where view), and limiting groups
(Having view) criteria as appropriate.
5 Click the Return button to return to the Report painter.
Defining HAVING
criteria
If you have defined groups, you can define HAVING criteria to restrict the
retrieved groups. For example, if you group employees by department, you can
restrict the retrieved groups to departments whose employees have an average
salary of less than $50,000. This corresponds to:
SELECT dept_id, sum(salary), avg(salary)
FROM employee
GROUP BY dept_id
HAVING avg(salary) < 50000
If you specify this with the Employee table in the EAS Demo DB, you will get
three rows back, because there are three departments that have average salaries
less than $50,000.