the same number of data items, in the same order, and must all be the same data type, and have the same data item name
Yes, except for the dataitem name (no reason to be the same)
Both SQL and Cognos will take the first set of the union to determine naming.
Procedure:
1. Create query1
2. Create query2 (copy query1 for instance
Make sure that order number of dataitems and type are same
3. Drag a union from the toolbox
4. In the query editor drag query1 and query2 into the union (at the right side)
5. The outcome will be called query3
Unfortunaly Cognos has refrained from adding (all) dataitems into query3
You have to manually drag them into the query (this is the part that is not obvious).
Query3 is empty right after creation
The reason is that you do not need to select ALL dataitems. If your query1 and 2 have each 10 dataitems, then it is okay to use just 6 in query3 (= possible, not logical)
You use query 3 for reporting purposes
Ties Blom