Vertical pivot

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
babbu9
Premium Member
Premium Member
Posts: 75
Joined: Tue Jun 01, 2004 9:44 am

Vertical pivot

Post by babbu9 »

Hi
I have a vertical pivot requirement.


Table1
col1 col2
X 2
X 3
X 4
Y 1
Y 2

Table2

col1 col2 col3 col4
X 2 3 4
Y 1 2 0

If the values in the first col1 are equal then the corresponding values in
col2 then should be mapped to table2 cloumns 2,3,4. If no values are found then it should be mapped with 0.

Please suggest.

Bob
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What did your search for "vertical pivot" on this site reveal?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
babbu9
Premium Member
Premium Member
Posts: 75
Joined: Tue Jun 01, 2004 9:44 am

Post by babbu9 »

Ray
I have gone through the vertical pivot posts on this forum but they donot specifically talk about comparing values in the first column, rather they are simple vertical pivots.

If would appreciate if you could help me in this regard.

Thanks
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
Sounds like a simple vertical pivot + filtering on the results to me.
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There is a very simple approach using stage variables. It may be posted on the server forum, but it will work just as well in parallel jobs. You just have to make sure that the data are partitioned on the first column values so that all values of each distinct value are on the one partition.
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