### Grouping data in intervals

You may want to group your data into intervals. Age groups, time periods, and sales categories are some of the interval groupings that can be created. In this example, you will rank customers by the amount of business they did in the previous year.

This example uses specified order grouping. This kind of grouping lets you specify the records that will be included in each group. You define the intervals you want and the program will do the rest.

###### To group data in intervals

1. Create a report using the sample data, `Xtreme.mdb`, and place the following fields from left to right in the Details section:

    {customer.CUSTOMER NAME}
    {customer.REGION}
    {customer.POSTAL CODE}
    {customer.COUNTRY}
    {customer.LAST YEAR'S SALES}

1. Right-click the Last Year's Sales data field and choose Insert Subtotal.

   The Insert Subtotal dialog box appears.

2. You want to set up intervals based on the previous year's sales so select Last Year's Sales as the sort-and-group-by field from this drop-down list.
3. Select in specified order from the second drop-down list.

   The Specified Order tab appears in the Insert Subtotal dialog box.

4. Click the New button.

   The Define Named Group dialog box appears.

5. Type "Less than $10,000" in the Group Name field.

   This is the name that will appear as the Group Name field value for the group.

6. Since the first group is to contain only those records that have a Last Year's Sales figure of less than $10,000, set the fields so your condition reads:

``is less than 10000``

1. Click OK to return to the Specified Order Tab.
2. Click New.

   The Define Named Group dialog box reappears.

3. Set up a second group that contains values between $10,000 and $25,000.
   - Type "$10,000 to $25,000" in the Group Name field.
   - Set the first field so the condition reads: `is between`
   - Specify a range of values:
     - type "10000" in the top field
     - type "25000" in the bottom field

       You have now set up the group to contain all values between $10,000 and $25,000.

4. Click OK to return to the Specified Order tab.
5. Click New.

   The Define Named Group dialog box reappears.

6. Set up the final group that contains all values over $25,000.
   - Type "Over $25,000" in the Group Name field.
   - Set the first field so the condition reads: `is greater than`
   - Type "25000"
7. Click OK to return to the Specified Order Tab.
8. Click OK. The report is grouped by interval in a specified order. Your report should look similar to the following report:

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