Page 1 of 1

transformation logic

Posted: Sat Mar 08, 2008 2:27 am
by prasson_ibm
my input values are in this hierarchy format:-
depth,name
1,a1
2,b1
3,c1
1,a2

and i want output in this format:-
1 2 3
a1
a1 b1
a1 b1 c1
a2

i m using this logic:-

d=stageveriable for o/p col1
if depth=1 then input.name else d

f=stageveriable for o/p col2
if depth=2 then input.name else f

r= stageveriable for o/p col3
if depth=3 then input.name else r

with this logic last row is coming like this:-
a2 b1 c1
but it should come
a2


pls help me as soon as possible

Re: transformation logic

Posted: Sat Mar 08, 2008 6:32 am
by sanjay
Hi
once you derive

1 2 3
a1
a1 b1
a1 b1 c1
a2

again check for col 1 in stage variable if there is change in row make col 2 and col 3 has bank
Thanks


prasson_ibm wrote:my input values are in this hierarchy format:-
depth,name
1,a1
2,b1
3,c1
1,a2

and i want output in this format:-
1 2 3
a1
a1 b1
a1 b1 c1
a2

i m using this logic:-

d=stageveriable for o/p col1
if depth=1 then input.name else d

f=stageveriable for o/p col2
if depth=2 then input.name else f

r= stageveriable for o/p col3
if depth=3 then input.name else r

with this logic last row is coming like this:-
a2 b1 c1
but it should come
a2


pls help me as soon as possible

Posted: Sat Mar 08, 2008 11:10 am
by kumar_s
Will the output number of fields will be always constant? As giving in this example, 3?
And please avoid ASAP marks.