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
kurapatisrk
Premium Member
Posts: 15 Joined: Wed Feb 24, 2010 6:37 pm
Location: United States
Post
by kurapatisrk » Wed May 11, 2011 12:37 pm
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
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Wed May 11, 2011 4:20 pm
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 » Wed May 11, 2011 4:28 pm
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
Posts: 72 Joined: Mon Jul 06, 2009 9:34 pm
Location: Sydney
Post
by prakashdasika » Wed May 11, 2011 8:05 pm
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 » Wed May 11, 2011 11:25 pm
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 » Wed May 11, 2011 11:48 pm
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
Posts: 72 Joined: Mon Jul 06, 2009 9:34 pm
Location: Sydney
Post
by prakashdasika » Thu May 12, 2011 1:33 am
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