Search code examples
pentaho

How to make a row into column in PENTAHO


I have a file like this:

COUNTRY | 2008 | 2009 | 2010 | 2011 | 2012 | TYPE
SPAIN      5      41     8      12      5     T1
SPAIN      4      6       2      7      14    T2
SPAIN      7      8      9       6      2     T3
FRANCE     4      5      7       9      66    T1
FRANCE     14     3      4       12     12    T2
FRANCE     5      8      11       3      6    T3
...

And I need to convert it into a format like:

COUNTRY | YEAR | T1 | T2 | T3
SPAIN     2008   5    4    7
SPAIN     2009   41   6    8
....

Thanks


Solution

  • If you're talking about Pentaho Data Integration you can use the Row Normalizer step. It allows you to define the columns that hold measure types, and convert them into a single "type" column.

    Check the documentation for examples of usage.