### Grouping the data

Data in a table is usually organized into groups based on certain criteria. You can define multi-level groups in your table either when creating it or after the table has been built. In this section, you will be shown how to define groups in an existing table.

To group data of an existing table:

1. Select the table and do one of the following:
   - Click Insert > Group on the menu bar.
   - Click the Insert Group button on the Insert toolbar.
   - Right-click the table and select Table Wizard from the shortcut menu.
2. In the Table Wizard, select the Group screen. See the screen.

3. Select the field from the Resources box as the grouping criterion, and then click to add it to the group by box (the box on the right). And if the type of the group by field is Numeric/String/Date/Time, you can select a special function for the field as required.
4. Set the sorting manner of groups at this group level in the Sort column.
5. Click the Select N button to specify the Select N condition.
6. If you want to filter groups at this group level, click the Group Filter button, and then specify the filter conditions.
7. Repeat the above steps to add more groups.
8. Click Finish to apply the settings.

One or more GH-GF (group header and group footer) row pairs with the selected group fields will have been added to the table.

Note: The following SQL type of data cannot be grouped: Db.SQL_BINARY, Db.SQL_BLOB, Db.SQL_CLOB, Db.SQL_LONGVARCHAR, Db.SQL_LONGVARBINARY, Db.SQL_VARBINARY and Db.SQL_OTHER.

The following are some specific topics about grouping:

- Specifying special function for group by field
- Setting the sort manner
- Specifying the Select N condition
- Filtering the groups
- Grouping data dynamically