How to accomplish Excel "Transpose" in TOS - Java?

One Star

How to accomplish Excel "Transpose" in TOS - Java?

Bonjour,
I thought it would be simple but it is not really easy.
I tried to reproduce what I've found in the forum but due to lack of details I'm not able to do what is says in: http://www.talendforge.org/forum/viewtopic.php?pid=16365
I simply would like to transpose the data like:
h1;h2;h3
val1a;val1b;val1c
val2a;val2b;val2c
valNa;valNb;valNc
into
h1;val1a;val2a;valNa
h2;val1b;val2b;valNb
h3;val1c;val2c;valNc
I'm using the Java engine so tPivotToRows is not available to me. Is there an external component that I could download to accomplish this easily?
Thanks for your help.
PM
One Star

Re: How to accomplish Excel "Transpose" in TOS - Java?

Hi,
1) Use tDenormalize with 3 input fields (columns)
2) Use tmap to concatenate the 3 output fields to merge to one output from tmap.
row2.f1 + "~" + row2.f2 + "~" +row2.f3
3) use tnormalise taking in the one field from the tmap and a separater of "~"
4) gives you :-
h1,val1a,val2a,valNa
h2, val1b, val2b, valNb
h3, val1c, val2c, valNc
HTH
One Star

Re: How to accomplish Excel "Transpose" in TOS - Java?

Thanks that helps a lot !!