Page 1 of 1

Data transformation -design question

Posted: Mon Nov 24, 2008 10:44 am
by dscon9128
Hi ,

I have a requirement to perform the following transformation , but im not sure how i could go about it. Ive been trying to play around with it, but my efforts have led to dead ends :(.

Brand---- code---------- Position
A------ 1 ----------------- X
A------ 1 ----------------- Y
A------ 1 ----------- Z
B------ 2 --------------- U
B--------- 2 ----------------- V

This should convert to

Brand ---- Code--- Position1--- Position2--- Position 3
A ---------- 1 ------- X---------- Y----------- Z
B ------------ 2 ------ U-----------V

Ideally i would like to convert it to :

Brand -----Code -- Position
A ----------- 1----- XYZ
B ------------2----- UV


I dont know which one is easier to do, if at all feasible.

Thanks for your time and help!

Posted: Mon Nov 24, 2008 10:47 am
by ArndW
Sort your data by Brand and Code. Create a stage variable to detect when Brand:Code changes, create another that stores the concatenated string value of "Position" and output that when the Brand:Code changes.

Posted: Mon Nov 24, 2008 4:59 pm
by dscon9128
Thanks for the response. I dont have the previlige of premium membership, but the little that i could see (using stage variables ) tipped me in the right direction :). I stuck a dummy count column in front of brand and code which would take the same value (say 1) ,as long as brand and code didnt change. At the same time,while looping within 1, i concatenated the positions within the transformer. When brand and code changed, i would repeat the same process for the next different value of the dummy count (Say 2).

Thanks again for your time!