if i have more than 10 keys columns to vertical pivot logic
Posted: Fri Apr 17, 2009 9:40 pm
hi All,
I have a requirement in which i have 10 keys columns and i need to perform vertical pivot conversion for the data.
Please suggest..
Here is the example
INPUT:-
AKey BKey CKey DKey EKEY FKEY GKEY HKEY IKEY JKEY SeqNoKEY ADD
1 2 11 a b c d e f g 1 A
1 2 11 a b c d e f g 1 P
1 2 11 a b c d e f g 1 P
1 2 11 a b c d e f g 1 L
1 2 11 a b c d e f g 1 E
OUTPUT:-
AKey BKey CKey DKey EKEY FKEY GKEY HKEY IKEY JKEY ADD
1 2 11 a b c d e f g APPLE
I tried using the using stage variables in transformer stage and passing to Remove duplicate stage and using the below logic
StgVarCurrent;- (AKey: BKey: CKey: DKey: EKEY; FKEY: GKEY: HKEY: IKEY: JKEY)
stgvarpervious:- StgVarcurrent
StgVarADD:- ADD
StgVarlogic- If StgvarCurrent<> StgVarPerious then StgVarlogic else StgVarADD:StgValogic
Please correct me if my logic is wrong and i am not getting the required output
Please note i have not used Seq_no anywhere in my logic
Thanks
I have a requirement in which i have 10 keys columns and i need to perform vertical pivot conversion for the data.
Please suggest..
Here is the example
INPUT:-
AKey BKey CKey DKey EKEY FKEY GKEY HKEY IKEY JKEY SeqNoKEY ADD
1 2 11 a b c d e f g 1 A
1 2 11 a b c d e f g 1 P
1 2 11 a b c d e f g 1 P
1 2 11 a b c d e f g 1 L
1 2 11 a b c d e f g 1 E
OUTPUT:-
AKey BKey CKey DKey EKEY FKEY GKEY HKEY IKEY JKEY ADD
1 2 11 a b c d e f g APPLE
I tried using the using stage variables in transformer stage and passing to Remove duplicate stage and using the below logic
StgVarCurrent;- (AKey: BKey: CKey: DKey: EKEY; FKEY: GKEY: HKEY: IKEY: JKEY)
stgvarpervious:- StgVarcurrent
StgVarADD:- ADD
StgVarlogic- If StgvarCurrent<> StgVarPerious then StgVarlogic else StgVarADD:StgValogic
Please correct me if my logic is wrong and i am not getting the required output
Please note i have not used Seq_no anywhere in my logic
Thanks