Page 1 of 1

Clarification on Pivot Stage

Posted: Tue Mar 09, 2010 12:28 am
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.

Posted: Tue Mar 09, 2010 1:08 am
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.

Posted: Tue Mar 09, 2010 3:23 am
by ReachKumar
Hi Ray,

Thanks for the reply.
Can you explain in more detial.

Posted: Tue Mar 09, 2010 5:26 am
by ray.wurlod
Not really. What can't you understand?

Posted: Thu Mar 25, 2010 12:27 am
by ReachKumar
I am not able to view the entire data.

Anyways I understand the logic.

Thank you so much for the clarification Ray.