How do I transpose a table in Pentaho Kettle from

2019-06-24 13:55发布

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?

1条回答
混吃等死
2楼-- · 2019-06-24 14:23

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

查看更多
登录 后发表回答