Reverse Pivoting

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
jbkishore
Participant
Posts: 3
Joined: Mon Jan 14, 2008 4:18 am

Reverse Pivoting

Post by jbkishore »

[b]Hi,
there are three columns empid, salmonth, sal contains the values 101,jan,1000
101 feb 1000
like twelve rows are there then my required out put is like
contains 13 columns empid jan feb march.......dec and the values are
101 1000 1000 1000 like this.

Thank you.. [/b]
nani0907
Participant
Posts: 155
Joined: Wed Apr 18, 2007 10:30 am

Post by nani0907 »

you need to write logic using stage variables.

first keep a flag for new and repeated values of emid and slao take counter in another stage var.
in third stage varible based upon the flag of 1 stage varoiable coancate the salmnt &sal.

then sort and rove dups..
thanks n regards
nani
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

:idea:
I think you need a new keyboard fairly soon, Nani - your current one seems to be skipping characters.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Welcome aboard.

Search DSXchange for "vertical pivot" (another name for reverse pivot) to learn techniques.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply