Add up a group_index for each ID in Dataset

daniel_foersterdaniel_foerster Member Posts: 5 Contributor I
edited December 2018 in Help

Given following example set:

id;group_index

1

1

1

1

1

2

2

2

2

2

3

3

3

3

3

3

 

and i want the group index to be filled like:

id;group_index

1;1

1;2

1;3

1;4

1;5

2;1

2;2

2;3

2;4

3;1

3;2

3;3

3;4

 

How an i manage this? i tried loop values in combination with generate attributes but it's setting 1 for each ID or count up in one row.

 

 

Thank you!

Answers

  • MartinLiebigMartinLiebig Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,503 RM Data Scientist

    Hi,

     

    Group Into Collection + Loop Collection with Generate ID inside is at least one way of doing it.

     

    BR,

    Martin

    - Sr. Director Data Solutions, Altair RapidMiner -
    Dortmund, Germany
  • BalazsBaranyBalazsBarany Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert Posts: 955 Unicorn

    Hi,

     

    you could check out this project:

    https://github.com/bbarany/rapidminer-windowfunctions

     

    Your request is an application of window functions, available in relational databases. The project mentioned there implements these in RapidMiner. You can use this process, group by the id and use the row_number() function to get exactly the result you want.

     

    Regards,

    Balázs

  • hyukiehyukie Member Posts: 2 Contributor I
    @mschmitz how i can group into collection and make loop collection
    can u explain step by step
  • yyhuangyyhuang Administrator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 364 RM Data Scientist
Sign In or Register to comment.