COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: KKSaland on 08 Jan 2014 12:32:55 PM

Title: Unions and Grouping with Totals
Post by: KKSaland on 08 Jan 2014 12:32:55 PM
I have queries A, B and C.  A and B equal Union 1.  Union 1 and C equal Union 2.  I am using Union 2 for my list report.  My problem is when I group by Area and Department I only get a total by Area and nothing by Department.  I need both.  Any assistance would be appreciated.

.k
Title: Re: Unions and Grouping with Totals
Post by: hittony on 09 Jan 2014 05:04:02 AM
I think you should give more details for that someone could help you ;)

Do you have something in your list column Department before grouping ?
Title: Re: Unions and Grouping with Totals
Post by: Lynn on 17 Feb 2014 12:49:00 PM
Why do you union A and B and then union the result with C? Why not just create one union with A, B, and C?
Title: Re: Unions and Grouping with Totals
Post by: BigChris on 18 Feb 2014 02:37:59 AM
Can you do that? I genuinely thought you could only union two queries at a time. If you can union three (or more) that would be excellent. Is that something that's only in later versions / updates?
Title: Re: Unions and Grouping with Totals
Post by: MFGF on 18 Feb 2014 05:39:17 AM
Quote from: BigChris on 18 Feb 2014 02:37:59 AM
Can you do that? I genuinely thought you could only union two queries at a time. If you can union three (or more) that would be excellent. Is that something that's only in later versions / updates?

Yep! Once you have the obvious two queries feeding into your union, simply drag another query and drop it onto the Union object. It's been there as long as I can remember - I'm pretty sure it was there in Cognos 8... It's just not obvious unless someone tells you or you stumble on it by accident :)

(https://image.ibb.co/g8W67v/Unions_zps23cd445e.png)

MF.
Title: Re: Unions and Grouping with Totals
Post by: BigChris on 18 Feb 2014 05:55:23 AM
(Expletive deleted) brilliant!! That's just made my morning. Thanks all.