Pivot Table - Row Counter

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
cgarciadesc
Premium Member
Premium Member
Posts: 2
Joined: Tue Feb 24, 2004 11:50 am

Pivot Table - Row Counter

Post by cgarciadesc »

How can I add a column that takes the number of the row for each key and column converted into rows :?:
e.g.

from this:
key, c1, c2, c3
A, 10, 20, 30

to this:
key, count, value
A, 1, 10
A, 2, 20
A, 3, 30
raju_chvr
Premium Member
Premium Member
Posts: 165
Joined: Sat Sep 27, 2003 9:19 am
Location: USA

Re: Pivot Table - Row Counter

Post by raju_chvr »

Use Stage variables in Transformer.

A similar post was made on this site before. You can search for it.

viewtopic.php?t=86110&highlight=multiple
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The Pivot stage does not do any transformations.
It's easiest to follow the Pivot stage with a Transformer stage. That's where you'd use the stage variable.
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