You generate statistics to enable you to display data in a summarized form. The following diagram shows a statistic for sales per airline carrier from the flight connections example.
You are assigned to a user group, QD, for example.
YProceed as follows to generate the statistic shown above:
Create a new query (S1) for the DEMO_FLBOOKING (flight bookings) InfoSet.
Specify a title, the format, and some notes.
Click on the Next Screen function to get to the Field Groups Selection screen, and add the Flight Plan and Flight Table field groups.
Click on the Next Screen function to get to the Field Selection screen, and add the Carrier ID and Total number of confirmed bookings fields.
Click on the Statistics pushbutton to switch to the Statistics series of screens.
You determine the statistics in this series of screens. Each statistic must have its own unique title, since you may generate several statistics.
Specify the sequence in which you want to output the fields and state whether you want them to be sorted in ascending or descending order.
Totals are always calculated for numeric fields. You can therefore determine average values, the number of selected records, and the percentage share.
For more information on sums in statistics and ranked lists and how to convert them, see Sums and Conversion.
Use the Next Statistic function to create an extra statistic for the same query.
You can define up to 9 statistics for each query.
You create this second statistic definition on the Statistics 2 screen.
Give all the fields the same value as in statistic 1 and type 3 into the Rnd column.
The annual sales in DM were output in the first statistic. Placing a 3 in the Rnd column rounds the figures to the nearest thousand.
Use the Test function to test the query.
The statistics are displayed one after the other.
After the statistics, you get an overview stating which currency conversions were performed, as well as the date and exchange rate on which the conversions were based.
The overview also provides information about quantity conversions and the conversion factor.
Additional Functions
Lead columns
Every statistic has lead columns. They are determined by the query itself. The Key color attribute is assigned automatically to all non-numeric fields. When you scroll horizontally, these fields always remain visible on the screen.
Subtotal St
See: Sorting: Example 1
New page NP
See: Sorting: Example 2
Output length Len
When you define statistics, you can change the output length of the fields. This may be necessary, for example, when overflows occur as a result of summing numeric fields. To do this, specify the desired output length in the column Len on the Statistic Structure screen.