Sorting Groups Using Specified Order

Objective

After completing this lesson, you will be able to reorganize a group in a specified order.

Specified Order Grouping

You want to group your data in ways that aren't reflected by your database fields. For example, instead of grouping your regions alphabetically, or from the best-selling region to the lowest, you want to sort them geographically.

A screenshot of a Change Group Options dialog in a reporting application showing the Common tab active and, under the prompt When the report is printed, the records will be sorted and grouped by, a field set to Customer.Country with the sort-order dropdown expanded and the in specified order. option highlighted in blue, a note reading The section will be printed on any change of: Customer.Country, and three buttons labeled OK, Cancel, and Help along the bottom.

Specified order grouping enables you to create both the customized groups that appear on your report and the records that each group contain.

To specify the order of the grouping, select the field to which you want to apply the specified order grouping and then select in specified order.

The Specified Order tab appears at the top of the Insert Group dialog box.

In this tab, you can create custom group names and specify criteria for each. For example, you want to have two groups in your report, one for the Western Region and one for the Eastern Region. You could create these two groups by clicking the New button, then specify which states, provinces, or districts belong to each.

The order of the group names in this window is the order that they're printed on your report. You can reorder these groups by selecting the name and clicking the Up or Down buttons.

After creating a custom group, you must define which records belong to which group. You define this criteria in the Define Named Group dialog box. This dialog box functions exactly like the Select Expert.

Once you've created at least one custom group, a third tab appears on the Insert Group dialog box. This tab deals with the records that don't fall into any of the custom group categories. By default these records are included in a group called Others. You specify what to do with all the remaining records that don't meet any of the selection criteria of the custom groups in the Others tab.

Other Grouping Options

The below screenshot shows Other Grouping Options.

A screenshot of a Windows-style Change Group Options dialog box with the Others tab selected, showing four tabs across the top (Common, Options, Specified Order, Others), three radio options — Discard all others, Put all others together, with the name: (with a text field pre-filled with Overseas) and the currently selected Leave in their own groups — and standard action buttons OK, Cancel, and Help along the bottom, presented in a neutral, utilitarian interface.

The other grouping options include:

Discard all others
This option removes all other records from memory and does not show them on the report.
Put all others together, with the name:

This option enables you to specify a customized name for the "Others" group.

Leave in their own groups

This option groups all remaining records based on the group criteria. For example, if TX didn't fall into either Western or Eastern, all records for Texas would be put into a group called "TX.".

You can create groups from either the Design or Preview windows. If you're in the Design window, you'll see the new Group Header and Group Footer areas surrounding the Details area. For each group you define, a new Group Header and Group Footer is created.

Watch this video to know more about Grouping in Specified Order.

Hint

When you add a grand total, the grand total displays for all records selected by the Select Expert, not only for those showing on the report after creating specified groups. However, if you apply a specified order grouping and choose to discard others, your grand totals are correct, and calculate only the fields shown on the report.

Implement Specified Order Grouping

In this exercise, you will implement specified order grouping.

Summary

  • Specified Order Grouping allows for custom data grouping not reflected by database fields, such as sorting regions geographically.
  • To create custom groups, select a field, apply specified order grouping, and define criteria for each group.
  • These groups can be reordered, and unclassified records can be managed via the "Others" tab or discarded, with grouping options available in both Design and Preview windows.

Log in to track your progress & complete quizzes