Steps to create a query set

Procedure

  1. Select two query subjects that meet these requirements:
    • Each query subject must have the same number of columns.
    • Columns must be in the same order.
    • Columns must have the same or similar data types.

      The data types do not need to be exactly the same if those in the second result set can be automatically converted by the data source to data types compatible with those in the first result set.

      For example, one query subject contains country data and uses int as the data type. Another query subject contains country data and uses smallint as the data type. Framework Manager imports these query subjects as int16 and int32 and performs a set operation.

  2. Click Actions, Define Query Set.
  3. Click the Definition tab.
  4. In the Name box, give the query set a name.
  5. Review the Query Subject boxes to ensure the order that the query subjects will display in the Select clause is correct.

    The order could be important if you want a specific set of column names (aliases) that displays in only one of the query subjects. If the order is incorrect, cancel this query set and start again.

    For union and intersect, the order of the query subjects does not matter. You can change the order and receive the same answer. For except, the order of the query subjects does matter.

  6. Use the Operator box to define how the rows of the query subjects are combined.

    Option

    Description

    Union

    Retrieves all unique rows from both sets. Duplicates are removed.

    Intersect

    Retrieves rows that are common between the query subjects.

    Except

    Retrieves rows that exist in the first query subject and not in the second query subject.

  7. To create a Union All, Intersect All, or Except All operation, clear the Remove Duplicate Row check box.
  8. Choose the action that that you want.

    Goal

    Action

    Work with the calculations that are embedded in the query subjects

    Click the Calculations tab.

    You can add or edit the calculations and change the order of the calculations.

    Work with the filters that are embedded in the query subjects

    Click the Filters tab.

    You can add or edit the filters, change the order of the filters, and change the usage of filters.

    Test the query set

    Click the Test tab.

  9. Click OK.

Results

You may be interested in the following related topics: