Parameterize Pivot logic
Posted: Wed Dec 10, 2008 2:33 am
There is a scenario where the row values
Col1 | col#_1| col_data1| col#_2 | col_data_2| col6| col_data_3
100 | 1 | Z | 2 | Y | 3 | X
Using Pivot stage I'm able to achieve the output
C1 C2 C3 C4
100 1 Z A
100 2 Y A
100 3 X A
There are various inputs where the input columns Col#_1 and Col_data_2 may extend upto 'n' columns. I mean
Col#_1....col#_n
and
col_data_2.....col_data_n
The above logic and output patten is correct, however I need to make this job workable for 'n' number of Col#_1 and col_data_2 column values. With pivot we can hard coding the required columns in Pivot-->properties-->output -->derivation. I need to make this logic fit for more number of Col#_1 and col_data_2 columns for various inputs with single job.
Could you please suggest me some options?
Col1 | col#_1| col_data1| col#_2 | col_data_2| col6| col_data_3
100 | 1 | Z | 2 | Y | 3 | X
Using Pivot stage I'm able to achieve the output
C1 C2 C3 C4
100 1 Z A
100 2 Y A
100 3 X A
There are various inputs where the input columns Col#_1 and Col_data_2 may extend upto 'n' columns. I mean
Col#_1....col#_n
and
col_data_2.....col_data_n
The above logic and output patten is correct, however I need to make this job workable for 'n' number of Col#_1 and col_data_2 column values. With pivot we can hard coding the required columns in Pivot-->properties-->output -->derivation. I need to make this logic fit for more number of Col#_1 and col_data_2 columns for various inputs with single job.
Could you please suggest me some options?