COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Joel R on 05 Jul 2015 04:36:18 PM

Title: Multiple Rows in a list to single row
Post by: Joel R on 05 Jul 2015 04:36:18 PM
Hi Experts,

Need your help ASAP...

I am having a list as follows,

A    |     B    |    code   |    Description

1          2           x               xxxxxx
1          2           y               yyyyyy
1          2           z               zzzzzzz

** I have to change the above list as below

A  |    B     |    Code1  |   Desc 1  |  Code2  | Desc 2  |  Code 3 | Desc 3

1       2              X          xxxxxx        Y          yyyyyy      Z         zzzzzz


The following are the condtions to be met,

-- Combination of A & B should not be repeated
--- Desc field will be mapped to an external datasourse
-- Column heading should be as I mentioned above and output must be in csv format
I am a newbie to Cognos and doesnt have much insight into Crosstab, please help me with steps.

Thanks in Advance !!!!!!

Regards,
Joel R
Title: Re: Multiple Rows in a list to single row
Post by: Gyana on 08 Jul 2015 07:17:21 AM
Hi Joel,

Create 3 individual query & join them.

Query1 : With Filter = 'X'
            Column: A, B, Code1,Desc1

Query2 : With Filter [CODE] = 'Y'
            Column: A, B, Code2,Desc2

Query3 : With Filter [CODE] = 'Z'
            Column: A, B, Code3,Desc3

Then Join Query1 & Query2 ------- On A & B column---------Query4
Then Join Query5 & Query3 ---

In Final Query you pull A, B, Code1,Desc1,Code2,Desc2,Code3,Desc3


Cheers :)