Page 1 of 1

Save as csv in a cross tab format

Posted: Mon Jul 27, 2009 11:35 pm
by arnie_nits
Hi,

I have a set of records like

machinedesc machinegroupid machinegroupdesc

AAAA 1 b
BBBB 7 a
AAAA 2 d
BBBB 3 c
XXXX 7 a

now I want this as a cross tab like:

7 1 3 2
a b c d
AAAA # #

BBBB # #

XXXX #
and save in a file


Please help.

Regards,
Arnie.

Posted: Tue Jul 28, 2009 2:17 am
by Sainath.Srinivasan
Your requirement appears bit unclear to me.

If that is what you expect, you can send the columns in 3 seperate link, sort and write to individual sequential files with record delimiter as blank for first 2.

In the after job stage you can cat them together.

Posted: Tue Jul 28, 2009 2:28 am
by arnie_nits
Actually what I want to do is to make one column a row and so we will have it in matrix format.......
then the corresponding matching cells will be marked #.....

Posted: Tue Jul 28, 2009 2:34 am
by Sainath.Srinivasan
That appears to be the job of a reporting tool and not an ETL tool like datastage.

You can do that in Excel itself.