Clarification on Pivot Stage

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
ReachKumar
Participant
Posts: 29
Joined: Wed Jan 06, 2010 7:18 am

Clarification on Pivot Stage

Post by ReachKumar »

Hi,

I thought Pivot stage is used to convert Columns into Rows.

INPUT:
------
ID : 1
NAME : ONE
AGE : 10
RATTING : 100

Derivation for the First column : ID,NAME
Derivation for the Second column : NAME,AGE,RATTING

OUTPUT:
-------
"1","ONE"
"ONE","10"
"","100"

Here the Columns are converted into Rows as expected

But i was confused with the following scenario,

Input is same as before

Derivation for the First column : ID
Derivation for the Second column : NAME,AGE,RATTING

OUTPUT:
-------
"1","ONE"
"1","10"
"1","100"

If Pivot is used to convert Columns into Rows then the Second and Third rows in the output, should not have value for the first column instead of value : 1

Can anyone clarify how the output is generated in the later scenario.
Regards,
Kumar
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

In scenario 2 you have two pivot keys so will get two columns in the output. The first output column will pivot on all columns in its derivation, but there is only one column mentioned, so this value will occur in all rows.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ReachKumar
Participant
Posts: 29
Joined: Wed Jan 06, 2010 7:18 am

Post by ReachKumar »

Hi Ray,

Thanks for the reply.
Can you explain in more detial.
Regards,
Kumar
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Not really. What can't you understand?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ReachKumar
Participant
Posts: 29
Joined: Wed Jan 06, 2010 7:18 am

Post by ReachKumar »

I am not able to view the entire data.

Anyways I understand the logic.

Thank you so much for the clarification Ray.
Regards,
Kumar
Post Reply