Show TOC

Procedure documentationSorting: Example 2 Locate this document in the navigation structure

 

The following example demonstrates how you can use local fields with calculations which depend on conditions in a sorted statistic. The statistic contains quarterly sales figures of individual airline carriers for a year which you specify on the selection screen.

Prerequisites

  • You have defined the query S1 as described in Compiling Statistics.

  • You are in the Statistics screen sequence.

Procedure

  1. On the Field Selection screen, define the local fields as shown in the following illustration (see also Assigning Short Descriptions and

    Defining Local Fields):

    This graphic is explained in the accompanying text.

    The field Year is a local field which you specify on the selection screen. Its value determines the year for which quarterly sales figures are required.

    This graphic is explained in the accompanying text.

    There are two things to take into account with the fields for quarterly sales figures. The InfoSet retrieves per flight (flight date) the total existing bookings. Using the flight date, you can thus determine to which quarter this total is to be assigned. Furthermore, only the quarters of a pregiven year should be determined according to the task. A quarterly sales figure is, therefore, the same as the booking total if the flight data lies in the pregiven year and in the correct quarter. As an example, we can use the definition of the field for bookings in the 2nd quarter.

    This graphic is explained in the accompanying text.

    Note that this example uses a replacement variable (&Y) in the column header.

  2. Once you have defined all local fields, change to the Statistics screen sequence by clicking on the Statistics pushbutton.

  3. Choose Next Statistic to define a new statistic.

    Define the statistic as shown in the following illustration:

    This graphic is explained in the accompanying text.

  4. Use the Test function to test the query.

Result

The following list is displayed:

This graphic is explained in the accompanying text.