Using QMF

Narrowing row selection using multiple row conditions

You can create more than one row condition to further limit the data you want to display on the report.

The following example shows how to select only rows for employees who earn a commission and whose total earnings are greater than $17,000.00. To select those rows, you need to create two row conditions: one to select only employees who earn a commission and another to select employees whose total earnings are greater than $17,000.00. Only the rows that meet both conditions appear on the report.

To create multiple row conditions:

  1. Select the table and the columns for your report.
  2. Press Enter to select choice 3, Row Conditions, on the Specify panel.
  3. On the Row Conditions panel, enter the column on which you want to base your first row condition. For this example, select the COMM column.
  4. On the Comparison Operators panel, enter the verb and the comparison operator for the row condition. For this example, select the verb Is not and the comparison operator NULL. This combination selects employees who earn any commission.

    You have created the first row condition. The row condition is displayed in the echo area, and the Specify panel displays with no choice selected.

    Now you create the second row condition.

  5. On the Specify panel, select choice 3, Row Conditions. The Condition Connectors panel displays.
  6. Enter 1 to select rows that meet either of the conditions, or enter 2 to select rows that meet both of the conditions. For this example, enter 2 to select rows that meet both conditions.

    Figure 33. The Condition Connectors panel

    +--------------------------------------------------------------------------------+
    | PROMPTED QUERY                                       MODIFIED  LINE    1       |
    |                                       +-------------------------------------+  |
    |   Tables:                             |        Condition Connectors         |  |
    |     Q.STAFF                           |                                     |  |
    |                                       | Select a connector.                 |  |
    |   Columns:                            |                                     |  |
    |     NAME                              |   1. Or  (Either condition is true) |  |
    |     DEPT                              |   2. And (Both conditions are true) |  |
    |     SALARY                            +-------------------------------------+  |
    |     COMM                              | F1=Help  F12=Cancel                 |  |
    |     SALARY+COMM                       +-------------------------------------+  |
    |                                                                                |
    |   Row Conditions:                                                              |
    |     If COMM is not NULL                                                        |
    |   > ...                                                                        |
    |                                                                                |
    |   *** END ***                                                                  |
    |                                                                                |
    |                                                                                |
    |                                                                                |
    |                                                                                |
    +--------------------------------------------------------------------------------+

    The Row Conditions panel displays.

  7. On the Row Conditions panel, enter the column on which you want to base your second row condition. For this example, select the choice Expression (A+B, etc.) at the bottom of the Row Conditions panel to create a SALARY+COMM column like the one you created in Creating a column using expressions.
  8. On the Comparison Operators panel, enter the verb and the comparison operator for the row condition. For this example, select Is and Greater than.
  9. If a panel displays for the comparison operator you selected, enter the value you want to use to select the rows. For this example, enter 17000 (without commas or quotes).

    You have created the second row condition. Both row conditions are displayed in the echo area, and the Specify panel displays, with no choice selected for you.

    Figure 34. The query shows both row conditions you created.

    +--------------------------------------------------------------------------------+
    | PROMPTED QUERY                                       MODIFIED  LINE    1       |
    |                                                    __________________________  |
    |   Tables:                                          |        Specify         |  |
    |     Q.STAFF                                        |                        |  |
    |                                                    | Select an item.        |  |
    |   Columns:                                         |                        |  |
    |     NAME                                           |   1. Tables...         |  |
    |     DEPT                                           |   2. Columns...        |  |
    |     JOB                                            |   3. Row Conditions... |  |
    |     SALARY                                         |   4. Sort...           |  |
    |     COMM                                           |   5. Duplicate Rows... |  |
    |                                                    |________________________|  |
    |   Row Conditions:                                  | F1=Help  F12=Cancel    |  |
    |     If COMM Is Not NULL                            |________________________|  |
    |     And SALARY+COMM Is Greater Than 17000                                      |
    |                                                                                |
    |                                                                                |
    |   *** END ***                                                                  |
    |                                                                                |
    |                                                                                |
    |                                                                                |
    |                                                                                |
    +--------------------------------------------------------------------------------+

Repeat these steps to create more row conditions. You can create as many row conditions as you need to select the data you want.


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