Summary functions can be specified for as many of these fields as you want, as long as that type of
function is valid for that type of field.
Summarizing columns in Query for iSeries reports
The collating sequence that you select (see Chapter 9, “Selecting a collating sequence in Query for
iSeries”) for your query has an effect on different parts of your query definition. If you choose the minimum
or maximum option for one or more of the SBCS, DBCS-open, and DBCS-either character fields in your
query, the selected collating sequence is used to establish the values that appear on your report. In some
cases, blanks are the minimum or maximum value (if a record does not contain data but has blanks in that
field) and are used for your query output.
A CCSID is associated with a collating sequence. Different CCSIDs can cause different results for
MINIMUM and MAXIMUM processing. See “CCSID and summary functions in Query for iSeries” on
page 253 for information on how CCSIDs affect summary functions.
Location of column summary values in Query for iSeries reports
In a report that lists the detail information from the query, summary values are shown directly below the
column(s) for which they are specified, at the end of the report, and/or after each report break. In a report
that lists summary information only, summary values are shown directly below the column headings after
any line of break fields for report breaks. Specifying whether you want detail or summary information is
described in Chapter 13, “Selecting output type and output form in Query for iSeries reports”.
Each type of summary is shown on a separate line. The descriptive abbreviation (TOTAL, AVG, MIN, MAX,
or COUNT) for each summary is placed to the left of the summary value, and is separated from the value
by at least one space. (You cannot change the placement of this information or the order in which the
summaries are shown.)
For example, if you have a result field of TOTDUE for which you want a total and maximum value to show
on the report, and you want a count of all records in the report, your report would look something like this:
Accounts Receivable Summary
NAME TOTAL DUE
Jones B D 5.00
Kagy R L 25.39
Vine S S .00
Johnson J A 140.28
Alison J S 36.36
Henning G K 1,900.50
Stevens K L 6.90
Wilson T N 15.00
Doe J W .00
FINAL TOTALS
TOTAL 2,129.43
MAX 1,900.50
COUNT 9
Each AVG, MIN, and MAX value is edited in the same way as the column in which it appears.
Chapter 11. Specifying report summary functions in Query for iSeries reports 137