Report Studio

Creating a Query Union

 

Create a union query to combine two or more queries into one result set.

To combine two queries, the following conditions must be met:

To create a query union:

  1. Pause the pointer over the query explorer button and click Queries.
  2. In the Insertable Objects pane, do the following:
  1. Drag Query to the work area.
  2. Drag Union, Intersect, or Except to the right of the query.
    Two drop zones appear to the right of the operator.
  3. Drag a Query object to each drop zone.

Two queries are created in the work area and a shortcut to each query appears in the drop zones.

  1. Double-click each query that makes up the union query and add the data items that you want.
  2. On the toolbar, press the back button to return to the Queries work area.
  3. Click the set operator that you added in step 3.
  4. In the Properties pane, click the Duplicates property and choose whether you want to remove or preserve duplicate rows.
  5. Double-click the Projection List property.
    The projection list shows the list of projected data items for the set operation.
  6. If you want Report Studio to automatically produce the list of projected data items, click Automatically generated.
    Report Studio generates the projection list using only one of the two queries being unioned.
  7. To add, delete, move, or rename data items in the projection list, click Manual and make the changes you want.
  8. Double-click the union query.
  9. In the Insertable Objects pane, on the source tab , drag the data items that you want to add to the query to the Data Items pane.

 

The union query is complete. You can now link it to a data container in the layout.

 

Related Topics: