Due to recent updates, all users are required to create an Altair One account to login to the RapidMiner community. Click the Register button to create your account using the same email that you have previously used to login to the RapidMiner community. This will ensure that any previously created content will be synced to your Altair One account. Once you login, you will be asked to provide a username that identifies you to other Community users. Email us at Community with questions.

"[SOLVED] Transposing Data Loop"

rowan_growan_g Member Posts: 47 Contributor II
edited June 2019 in Help
Hi,

Another simple question - having trouble getting acquainted with all the functions - it's going to take some time.

I've got a list of text as follows:

x1
y1
z1
x2
y2
z2
x3
y3
z3

And I want to transpose it to the following:

x1 y1 z1
x2 y2 z2
x3 y3 z3


I've managed to calculate the amount of iterations successfully using macros but I'm struggling to get it moving through the list of values. I've tried using a loop with a nested transpose process but something is missing.

Any help would be much appreciated.

Thanks again!!

Cheers,
Rowan

Answers

  • venkateshvenkatesh Member Posts: 15 Contributor II
    What you need is "Pivot" operator. check out the documentation for the operator, there is an example process showing how to use it
  • rowan_growan_g Member Posts: 47 Contributor II
    Thanks for that. I've actually been trying the pivot operator. Doesn't seem to be grouping them correctly.
    I've managed to generate a "group" number, group 1,2&3 for each of the variables - still wont pivot.
    Could you perhaps post an example?

    Updated data:

    Id  Group   Att1
    1       1        x1
    2       1        y1
    3       1        z1
    4       2        x2
    5       2        y2
    6       2        z2
    7       3        x3
    8       3        y3
    9       3        z3


    Or would this be more correct:

    Id  Group  Att1
    1      1        x1
    2      2        y1
    3      3        z1
    4      1        x2
    5      2        y2
    6      3        z2
    7      1        x3
    8      2        y3
    9      3        z3


    Thanks.

    Cheers,

  • rowan_growan_g Member Posts: 47 Contributor II
    Solved - used aggregate operator, set aggregation attributes to concatenate.
    http://rapid-i.com/rapidforum/index.php/topic,6602.0.html
Sign In or Register to comment.