COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: marzbuzz on 18 Jul 2017 05:15:45 PM

Title: Split a column to two columns
Post by: marzbuzz on 18 Jul 2017 05:15:45 PM
Hi gurus,
I want to split a code column that showing federal code and state code (it uses a filter for group in ('federal', 'state') )to two columns.

I created federal code data item (case when group in ('federal') then code else null end)and state code data item (case when group in ('state') then code else null end) in framework manager. I added a 2 columns 1 row table in the report for the column.

However the result is only showing either federal code or state code. Please let me how to fix this.


Thanks,
MB
Title: Re: Split a column to two columns
Post by: marzbuzz on 19 Jul 2017 08:36:00 AM
In the code, the state code may show before federal code. And I tried to avoid that by splitting the column.
Below are the example:

FROM:
---------
empid - code
-----------------------------
111     a   ca-a
222     a   ny-a
333     co-b   b
444     h   ca-h
...


TO:
---------
empid - fed - state
-----------------------------
111     a      ca-a
222     a      ny-a
333     b     co-b
444     h     ca-h
....

Much appreciate your help.

MB
Title: Re: Split a column to two columns
Post by: CognosPaul on 19 Jul 2017 09:53:17 PM
There are a few ways you could do this. First, are you certain you're always going to get aa-b and b-aa? It's always going to follow that pattern, or are other patterns possible?
Title: Re: Split a column to two columns
Post by: marzbuzz on 17 Oct 2017 09:55:55 AM
Thanks Paul.. The requirement has changed and this is not an issue now.

MB