COGNOiSe.com - The IBM Cognos Community

Legacy Business Intelligence => COGNOS ReportNet => Report Studio => Topic started by: dwsiva on 02 Jan 2008 10:07:15 PM

Title: Vertical columns to Horizontal Columns
Post by: dwsiva on 02 Jan 2008 10:07:15 PM
Hi

How can we convert the Vertical columns to Horizontal Columns
Ex:
     1     to   123
     2
     3

can anybody help me Please?
Title: Re: Vertical columns to Horizontal Columns
Post by: almeids on 03 Jan 2008 08:20:40 AM
You can do it the easy way, as a crosstab, and let Cognos do the work.  Or, if there is a relatively small finite set of values you want to column-ize you can do it as calculated data items in a list:

Col1=if ([dbcolumn]=1) then ([dbcolumn]) else (0)
Col2=if ([dbcolumn]=2) then ([dbcolumn]) else (0)
etc.

Depending on what you're trying to do you might want nulls rather than zeroes in the ELSEs.
Title: Re: Vertical columns to Horizontal Columns
Post by: Feanor on 03 Jan 2008 08:27:23 AM
Can you explain some more about your current report and your goal? Are you working with a list or crosstab?

Lists can be pivoted to crosstabs whereas within crosstabs you can swap rows with columns.
Title: Re: Vertical columns to Horizontal Columns
Post by: MFGF on 07 Jan 2008 03:51:30 PM
Hi,

You could also try using a repeater instead of a list.

Regards,

MF.
Title: Re: Vertical columns to Horizontal Columns
Post by: dwsiva on 31 Jan 2008 11:41:35 PM
HI
THANKS A LOT FOR YOU RESPONSE.........
MY REPORT IS AS FOLLOWS

C  C   C
O  O   O
L   L   L
U  U   U
M  M  M
N   N  N
1   2  3

BUT I WANT TO DISPLAY IT AS FOLLOWS
COLUMN1  COLUMN2 CLOUMN3


EXPECTING REPLY.......

REGARDS,
DWSIVA
Title: Re: Vertical columns to Horizontal Columns
Post by: ggreddi on 01 Feb 2008 09:04:39 AM
use the Rows to coulmn and coulmn to rows swap feature in cognos.