Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
CRW_REF.PDF
Скачиваний:
5
Добавлен:
13.02.2015
Размер:
13.99 Mб
Скачать

How to group 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 you can create using the process you will learn here. In this example, you will rank customers by the amount of business they did in the previous year.

This example uses in 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 get started, create a report using the sample data, CRAZE.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}

Right-click the Last Year’s Sales field and choose the INSERT SUBTOTAL command from the shortcut menu that appears. The Insert Subtotal dialog box appears. 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.

Sorting, Grouping, and Totalling

305

!Now click the down arrow in the Sort Order list box and select the in specified order option. The program creates a new Specified Order Tab in the dialog box.

" Click the Specified Order Tab to activate it.

#Click the New button. The Define Named Group dialog box appears.

306

Seagate Crystal Reports User’s Guide

$Type “Less than $10,000” in the Group Name edit box. This is the name that will appear as the Group Name field value for the group.

%Since the first group is to contain only those records that have a Last Year’s Sales figure less than $10,000, set the three dropdown boxes so your condition reads:

is less than 10000

& Click OK to return to the Specified Order Tab.

'Click New again, and again the Define Named Group dialog box appears. This time set up a second group that contains values from $10,000 to $25,000.

Type “$10,000 to $25,000” in the Group Name edit box.

Set the first two drop-down boxes so your condition reads: is between

Sorting, Grouping, and Totalling

307

The program creates a fourth drop-down box. There are now two drop-down boxes on the right, one above the other, with the word “and” separating them. Use these drop-down boxes to specify a range of values.

To specify the range:

type “10000” in the top drop-down box, and

type “25000” in the bottom drop-down box.

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

! Click OK to return to the Specified Order Tab.

" To set up your final group, all those values over $25,000, click the New button again.

# When the Define Named Group dialog box appears, type “Over $25,000” in the Group Name edit box.

$ Set the three drop-down boxes so your condition reads:

is greater than 25000

% Click OK to return to the Specified Order Tab.

& Immediately to the right of the Specified Order Tab is the Others Tab.

308

Seagate Crystal Reports User’s Guide

Use this tab to specify how you want it to handle all values that do not fit in any of the groups. Since all of the values in the Last Year’s Sales field fall in one of the three groups, you will not have to worry about your settings here, so click OK. The program returns you to your report.

Only one other thing remains in setting up your interval report and that is to insert group headers to identify each of the groups. If you insert the Group Name field into the Group Header (GH) section of your report, the program will use the name you assigned to each group to identify those groups in the report.

' Click the INSERT FIELDS button on the standard toolbar. The Insert Fields dialog box appears.

Click the Group Name Tab. There should only be one group name in the list: Group #1 Name.

Drag that name into the Group Header section.

Your report should look similar to this.

NOTE: This example report has been designed to illustrate concepts only, not the actual look of your finished report.

Sorting, Grouping, and Totalling

309

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]