COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Topic started by: vraju.springs@gmail.com on 14 Jul 2012 11:01:22 AM

Title: union
Post by: vraju.springs@gmail.com on 14 Jul 2012 11:01:22 AM
Hi All,
I have a requirement that in query explorer i have to create two queries one query which will return top three product lines and their revenue and other query will return top  two product lines and revenue. I have to show them in a list in such a way that product lines should be shown in pline column and revenue should shown in revenue column.  My data is dimensional data.
  I tried this using Union but unable to get the report please help me.
Thanks in advance.
   
Title: Re: union
Post by: wyconian on 15 Jul 2012 04:46:03 PM
Hi sounds like something you should be able to do with a union query. What problems are you having?
Title: Re: union
Post by: bi4u2 on 16 Jul 2012 09:04:07 AM
If you are trying to create a union you need to make sure that both queries have the same number of query items, in the same order and using the same names for the query items.
Title: Re: union
Post by: MFGF on 19 Jul 2012 05:23:06 AM
Wouldn't you end up with a list containing the top two product lines twice? Or are they different sets of product lines?

As bi4u2 said, you need to make sure both queries used in your union have the same number of items in the same order, with the same overall data types. The resulting query will inherit the names used in the first of your union queries, but the names do not strictly have to match.

Let us know what issues you are having, and we might be able to help you to get it working.

Cheers!

MF.