### Grouping data hierarchically

You have the option to group data in a report to show hierarchical relationships. When you group data hierarchically, you sort information based on the relationship between two fields.

For example, if you want to show the hierarchical structure of a department, you could group data by employee ID and specify the hierarchy using the data field listing whom the employee reports to.

###### To group data hierarchically

1. On the `Insert` menu, click `Group`.
2. In the Insert Group dialog box, select the field to be the basis of your hierarchy.

   For example, if you want to view the hierarchical structure of a company's employee's, select the employee ID data field. If you want to view the hierarchical structure of region sales offices, select office names.

3. Select `in ascending order`.
4. By default, the group header of the report will display the value of the field you are grouping on. Select the Customize Group Name field check box if you want to show a different value in the group header.

   For example, if you grouped by {Employee.EmployeeID}, at each change of a group you will see the corresponding employee ID. If you want to display a different value (employee name instead of employee ID), customize the group name field by choosing an alternate data field, or creating a formula.

5. Click OK.

   The group you created is added to the report.

6. On the `Report` menu, click `Hierarchical Grouping Options`.

   The Hierarchical Options dialog box appears.

7. Select the `Sort Data Hierarchically` check box.
8. In the Instance ID field list, select the group you want to organize hierarchically.

   Note: It will normally be the same field that you grouped by.

9. In the Parent ID field list, select the field by which you want the Instance ID field organized.

   For example, for a company hierarchal report, select the data field listing whom the employee reports to.

   Note: The type of the Instance ID and the Parent ID must be the same. For example, they both must be strings (text) or numbers.

10. In the Group Indent field, enter the amount you want to indent for each subgroup.
11. Click `OK`.

The report data is grouped hierarchically.

Note:

- The top level of the hierarchy is determined by group instances that match the Instance ID and Parent ID.
- If a group instance is not connected to any Parent ID, it appears at the top of the hierarchy.

Seagate Software, Inc. http://www.seagatesoftware.com Please send comments to: techpubs@seagatesoftware.com