Need some idea

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
ajithaselvan
Participant
Posts: 75
Joined: Mon Jul 12, 2010 4:11 am
Location: Chennai

Need some idea

Post by ajithaselvan »

Hi all,

Can anyone help me how to implement?
my input is like

col1 col2
a a1
a a2
a a3
b b1
b b2

I need to split the values in col2 as separate columns based on col1.
ie., if same group of col1 has diff vales in col2, then col2 values will be splited as separate columns

Output:
out_col1, out_col2, out_col3,out_col4
a , a1 , a2 , a3
b ,b1 ,b2, null


Regards,
Ajitha S
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That would be what is called a "vertical pivot", also known as rows to columns. So... pivot stage.
-craig

"You can never have too many knives" -- Logan Nine Fingers
venkatvelpula
Participant
Posts: 80
Joined: Sat Mar 18, 2006 10:27 pm

Post by venkatvelpula »

I think, Pivot stage can be used as long as you have same number of records for each key column group.
Post Reply