Data from long to wide format

winds
winds New Altair Community Member
edited November 5 in Community Q&A
I have some data I get from a SQL query like this:

[tt]Group    Value
1            12
1            14
2            23
2            24
...
[/tt]

and I'd like to output it to a file like this:

[tt]1    12,14,...
2    23,24,...
[/tt]

How can I do this with RapidMiner?

Thanks.
Tagged:

Answers

  • SebastianLoh
    SebastianLoh New Altair Community Member
    Hi winds,

    what you are looking for is the Pivot operator. Search for "pivot" in this forum and especially in the the Community Extension (View -> MyExperiment Browser) and you will find several examples how to use it.

    However, you'll need an index/item  attribute, eg.

    Group    Value  Index/Item
    1            12          1
    1            14          2
    2            23          1
    2            24          2
    ...

    Ciao Sebastian