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

Slaski picture Slaski · Mar 4, 2016 · Viewed 8.4k times · Source

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?

Answer

bolav picture bolav · Mar 4, 2016

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