Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I transpose a table in Pentaho Kettle from rows to columns without the header column

I'm new to Pentaho and I need to transpose a table from rows to columns, but the first column doesn't contain the headers.

It looks something like this:

Jan/15  Feb/15  Mar/15  Apr/15
1.1     3.4     1.7     2.0
2.5     4.5     2.4     3.3

And I need to convert to a table like the on below:

Month   Value A  Value B
Jan/15  1.1      2.5
Feb/15  3.4      4.5
Mar/15  1.7      2.4
Apr/15  2.0      3.3

Someone knows how can I achieve this? Is there some step that could help or only through scripts?

like image 460
Slaski Avatar asked Mar 04 '16 19:03

Slaski


1 Answers

You have to add the value name (A and B) to the row. And then first do a Row Normaliser, to make rows. Then you have to Row denormaliser, to get the two different values on the same row.

enter image description here

enter image description here

enter image description here

Convert string date, to date for correct sort: Screenshot of select values

enter image description here

enter image description here

enter image description here

like image 104
bolav Avatar answered Nov 05 '22 00:11

bolav