Vertical Pivoting...rows to colums

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
kurapatisrk
Premium Member
Premium Member
Posts: 15
Joined: Wed Feb 24, 2010 6:37 pm
Location: United States

Vertical Pivoting...rows to colums

Post by kurapatisrk »

Hi Gurus,

Since pivot stage doesn't support vertical pivoting rows to column, how can we implement vertical pivoting?

Example:

Col1 Col2
A 1
A 2
A 3

Output Should be :
Col1 Col2 Col3 Col 4
A 1 2 3

Please suggest. Thanks.
Thanks
Ksrk
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

First suggestion will always be to search the forums here, the topic of how to do a "vertical pivot" has been discussed here quite a bit.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If you have version 8.5 the PXPivot stage can perform vertical pivot.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
prakashdasika
Premium Member
Premium Member
Posts: 72
Joined: Mon Jul 06, 2009 9:34 pm
Location: Sydney

Post by prakashdasika »

Use the transformer stage and stage variables with the help of substring function to do it.
Prakash Dasika
ETL Consultant
Sydney
Australia
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

prakashdasika wrote:Use the transformer stage and stage variables with the help of substring function to do it.
Why substring function?
:?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vinu.dsx
Participant
Posts: 2
Joined: Thu Dec 23, 2010 3:45 am
Location: CHENNAI

Post by vinu.dsx »

chulett wrote:First suggestion will always be to search the forums here, the topic of how to do a "vertical pivot" has been discussed here quite a bit.
N.V.VINODH KUMAR
prakashdasika
Premium Member
Premium Member
Posts: 72
Joined: Mon Jul 06, 2009 9:34 pm
Location: Sydney

Post by prakashdasika »

If my input is from a database , where i have to convert multiple rows to columns i can extract all of then in a single row by a sql query and use a transformer with substring or a column import with a schema file defined. :)
Prakash Dasika
ETL Consultant
Sydney
Australia
Post Reply