Options

what is the operator to get the information as before the group by/aggregate operation?

AnushaAnusha Member Posts: 19 Maven
Hi All!

can anyone help with the opposite operator for the group by/aggregate?

I have the data on which someone has done group by of few attributes and aggregating few attributes. but I want the source data as it is.

sample input:

att1   attr2      attr3      attr4    attr5
789   gg|;bj     jd|;bd   89|;09   78|;87

output required:

att1    attr2       attr3    attr4     attr5
789    gg          jd         89        78
789     bj           bd       09         87

Thanks in advance!

Best Answer

  • Options
    BalazsBaranyBalazsBarany Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert Posts: 955 Unicorn
    Solution Accepted
    Hi @Anusha,

    probably you have more elements in one attribute than in the other. 

    Look at the data and search for the attribute with the largest number of elements. E. g. if attr1 has 4 elements, every attribute needs to have that number after the split. E. g. attr2_1, attr2_2, attr2_3, attr2_4. You can use Generate Attributes to create the empty attributes.

    De-Pivot needs the structure to be identical between the attributes.

    Regards,

    Balázs

Answers

  • Options
    BalazsBaranyBalazsBarany Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert Posts: 955 Unicorn
    Hi @Anusha,

    if you use Split with the regular expression \|; you'll get attributes of the form attr2_1, attr2_2, attr3_1, attr3_2 etc. The contents will be the original values split up accordingly.

    Then you can use De-Pivot. Index attribute is whatever you choose (a name not yet used in the example set), and in the attribute name list you can enter the different attributes:
    attr2          attr2.+
    attr3          attr3.+ 
    etc. 

    This will put the split attributes (identified by the regular expression) on the rows. 

    Regards,
    Balázs
  • Options
    AnushaAnusha Member Posts: 19 Maven
    Hi @BalazsBarany,

    actually, I have tried this process already but I'm getting an error.
    "mis matched attribute selection. the number attributes for attr1 and attr2 is different"
    How can I resolve this issue?
Sign In or Register to comment.