Previous Topic: The Report Format - Sort screenNext Topic: Step 2 - Create report groups


Step 1 - Sort your report rows

You specify how you want to sort your report rows on the Report Format - Sort screen. Your Report Format - Sort screen looks like this:

CA OLQ Release nn.n *** Report Format - Sort *** -> Page 1 of 1 133000 Specify sort or group by request and press the ENTER key Disp Sort Order Group By Seq Priority (A/D) Level # OLQ-EXAMPLE X LAST-NAME 1 _ _ _ X COUNTRY 6 2 a _ X FINISH-TIME 5 3 a _ X SEX 4 1 a _ Display lines: Detail X and/or Summary X Group by all _ Compute: 1=HELP 3=QUIT 4=MESSAGE 5=DISPLAY 6=MENU 11=HEADER

Sort Priority is used to specify the sort level. Order (A/D) is used to specify the sort order (ascending or descending).

                                      BOSTON MARATHON
                                         mm/dd/yy

                           LAST NAME    SEX    COUNTRY     FINISH TIME

                                       ┌─┐    ┌───────┐   ┌───────┐
                           VANDER WYK  │F│    │BELGIUM│   │2:54:12│
                           FRECETTE    │F│    │BELGIUM│   │3:10:01│
                           HELFGOTT    │F│    │BELGIUM│   │3:24:31│
Sort Level 3                           │ │    │       │   └─▲─────┘
Sort Field = FINISH-TIME ──────────────┼─┼────┼───────┼─────┘
Sort Priority = 3                      │ │    │       │
Sort Order = Ascending                 │ │    │       │
                                       │ │    │       │
                           DECRE       │F│    │FRANCE │    3:11:09
                           BENOTTI     │F│    │ITALY  │    3:12:42
                           FUCCI       │F│    │ITALY  │    3:40:37
                           BJORNSEN    │F│    │SWEDEN │    2:59:12
                           KLEIN       │F│    │USA    │    3:09:24
Sort Level 2                           │ │    └─▲─────┘
Sort Field = COUNTRY    ───────────────┼─┼──────┘
Sort Priority = 2                      │ │
Sort Order = Ascending                 │ │
                                       │ │
                           VANPRAAG    │M│     BELGIUM     2:45:60
                           MARTIN      │M│     FRANCE      3:10:29
                           GUERRIERI   │M│     ITALY       2:19:30
                           BARBADO     │M│     ITALY       2:40:12
                           YAMADA      │M│     JAPAN       2:30:41
                           KEEFE       │M│     USA         2:40:19
                           SIMON       │M│     USA         2:52:48
                           PARSONS     │M│     USA         3:00:04
Sort Level 1                           └*┘
Sort Field = SEX        ────────────────┘
Sort Priority = 1
Sort Order = Ascending
Sort Levels and Sort Order:
In this report, you want to sort your report rows by sex
(to group all of the women together), by country, and
within each country by race time.  You must sort
before you can specify any report groups.
┌────────────────────────────────────────────────────────────────────┐
│ If You Do Sort First                                               │
├────────────────────────────────────────────────────────────────────┤
│ Your report accurately reflects the fastest time for each country. │
├────────────────────────────────────────────────────────────────────┤
│                                                                    │
│                  BOSTON MARATHON                                   │
│                     mm/dd/yy                                       │
│                                                                    │
│ LAST NAME    SEX    COUNTRY     FINISH TIME                        │
│                                                                    │
│ VANDER WYK   F      BELGIUM     2:54:12                            │
│ FRECETTE     F      BELGIUM     3:10:01                            │
│ HELFGOTT     F      BELGIUM     3:24:31                            │
│                                                                    │
│                                 FASTEST FROM BELGIUM   :2:54:12    │
│ DECRE        F      FRANCE      3:11:09                            │
│                                                                    │
│                                 FASTEST FROM FRANCE    :3:11:09    │
│ BENOTTI      F      ITALY       3:12:42                            │
│ FUCCI        F      ITALY       3:40:37                            │
│                                                                    │
│                                 FASTEST FROM ITALY     :3:12:42    │
│ BJORNSEN     F      SWEDEN      2:59:12                            │
│                                                                    │
│                                 FASTEST FROM SWEDEN    :2:59:12    │
│ KLEIN        F      USA         3:09:24                            │
│                                                                    │
│                                 FASTEST FROM USA       :3:09:24    │
│        ┌──────────────────────────────────────────────────────┴───────────────┐
└────────┤ If You Don't Sort First                                              │
         ├──────────────────────────────────────────────────────────────────────┤
         │ If you sort by SEX, but forget to sort by COUNTRY, CA OLQ creates a  │
         │ group whenever it encounters a change in the COUNTRY column.  This   │
         │ causes inaccurate results when you try to calculate the fastest time │
         │ for each country.                                                    │
         ├──────────────────────────────────────────────────────────────────────┤
         │                                                                      │
         │                  BOSTON MARATHON                                     │
         │                     mm/dd/yy                                         │
         │                                                                      │
         │ LAST NAME    SEX    COUNTRY     FINISH TIME                          │
         │                                                                      │
         │ BENOTTI      F      ITALY       3:12:42                              │
         │ FUCCI        F      ITALY       3:40:37                              │
         │                                                                      │
         │                                 FASTEST FROM ITALY     :3:12:42      │
         │ VANDER WYK   F      BELGIUM     2:54:12                              │
         │                                                                      │
         │                                 FASTEST FROM BELGIUM   :2:54:12      │
         │ BJORNSEN     F      SWEDEN      2:59:12                              │
         │                                                                      │
         │                                 FASTEST FROM SWEDEN    :2:59:12      │
         │ FRECETTE     F      BELGIUM     3:10:01                              │
         │                                                                      │
         │                                 FASTEST FROM BELGIUM   :3:10:01      │
         │ KLEIN        F      USA         3:09:24                              │
         │                                                                      │
         │                                 FASTEST FROM USA       :3:09:24      │
         │ DECRE        F      FRANCE      3:11:09                              │
         │                                                                      │
         │                                 FASTEST FROM FRANCE    :3:11:09      │
         │ HELFGOTT     F      BELGIUM     3:24:31                              │
         │                                                                      │
         │                                 FASTEST FROM BELGIUM   :3:24:31      │
         └──────────────────────────────────────────────────────────────────────┘

Why You Have to Sort First: CA OLQ groups data by looking for a change in the value of the group field (COUNTRY). If the data is not sorted in order by the group field, the changes can occur at random and produce subtotals other than the ones you intended.