Using QMF

Adding a new column to a report

You can define a new column on the FORM.COLUMNS panel similar to the way you define a new column in a query.

For this example, you will add a total earnings (SALARY+COMMISSION) column for each employee.

To add a new column:

  1. On the FORM.COLUMNS panel, move the cursor to the column name after which you want to add the new column. In this example, move the cursor to the line for the COMM column.
  2. Press the Insert function key. A new column number displays.
  3. Type the column heading for the new column. For this example, type TOTAL_EARNINGS. Use an underscore to split the heading between two lines when it appears on the report.
  4. Press the Specify function key. The Specify panel displays.

    If you want to skip the Specify panel, type SPECIFY DEFINITION on the QMF command line. Then, move the cursor to the column you want to define and press Enter. The Definition panel for the column displays.

  5. Select Definition.
  6. Press Enter.

    Figure 80. The Definition panel

    +--------------------------------------------------------------------------------+
    |FORM.COLUMNS                                         MODIFIED                   |
    |+--------------------------------------------------------------------+          |
    ||                             Definition                             |          |
    ||                                                                    |          |
    || Column Number :     6                                              |          |
    || Column Heading:   TOTAL_EARNINGS                                   |          |
    ||                                                                    |          |
    || Type an expression to define this column.                          |          |
    || Expression  (_&4_+_&5____________________________________________) |          |
    || Pass Nulls? (_NO_____)                                             |          |
    |+--------------------------------------------------------------------+          |
    || F1=Help  F5=Previous Column  F6=Next Column                        |          |
    || F10=Previous Definition  F11=Next Definition  F12=Cancel           |          |
    |+--------------------------------------------------------------------+          |
    +--------------------------------------------------------------------------------+
  7. Type the expression you want to use to define this column. For this example, type &4+&5. That means that the value in this column is equal to the value in column 4 plus the value in column 5 (SALARY+COMM).
  8. Leave NO in the Pass Nulls field to process null values for the expression in this example.

    You can process null values if you are defining a column by using REXX EXECs.

    For more information on passing nulls and writing REXX EXECs, see the QMF Reference, SC26-4716-05 .

  9. Press Enter. You have finished defining the new column.
  10. Press the Cancel function key to close the Specify panel.
  11. Press the Report function key to display the changed report.

    Figure 81. The changed report shows the new column.

    +--------------------------------------------------------------------------------+
    |                                                    TOTAL                       |
    |   NAME         DEPT  JOB        SALARY        COMM  EARNINGS                   |
    |   ---------  ------  -----  ----------  ----------  ----------                 |
    |   KERMISCH       15  CLERK    12258.50      110.10  12368.60                   |
    |   NGAN           15  CLERK    12508.20      206.60  12714.80                   |
    |   ROTHMAN        15  SALES    16502.83     1152.00  17654.83                   |
    |   JAMES          20  CLERK    13504.60      128.20  13632.80                   |
    |   PERNAL         20  SALES    18171.25      612.45  18783.70                   |
    |   SNEIDER        20  CLERK    14252.75      126.50  14379.25                   |
    |   ABRAHAMS       38  CLERK    12009.75      236.50  12246.25                   |
    |   NAUGHTON       38  CLERK    12954.75      180.00  13134.75                   |
    |   O'BRIEN        38  SALES    18006.00      846.55  18852.55                   |
    |   QUIGLEY        38  SALES    16808.30      650.25  17458.55                   |
    +--------------------------------------------------------------------------------+


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]