[SOLVED] ROWNUMBER() in RapidMiner

mario_hofmann
mario_hofmann New Altair Community Member
edited November 2024 in Community Q&A
Hello,

currently I m trying to get my whole ETL for a process in Rapidminer. I ve got a table (A & B) like:

colA | colB | colC
A    | 2      | 1
A    | 4      | 2
B    | 1      | 1
C    | 2      | 1
C    | 3      | 2

Is there a way to create column C in rapidminer? In MS SQL I can use Row_Number and Partition (http://msdn.microsoft.com/de-de/library/ms186734.aspx) . I found a way using Loop Values, but this is far too slow for a table with several 10ks of examples.

Regards,

Mario
Tagged:

Answers

  • MariusHelf
    MariusHelf New Altair Community Member
    Hi Mario,

    what are you doing in Loop Values? Actually, to create an index for each unique value in column A, there is no other choice currently in RapidMiner than using Loop Values. Inside, you could use Generate ID, which should be quite fast.

    Best regards,
    Marius
  • mario_hofmann
    mario_hofmann New Altair Community Member
    Hi Marius,

    I was actually already doing the filtering inside the loop, just to generate the id is of course a much better idea. But I am close to finalize my process, I will report on the results. :)

    Regards,

    Mario
  • MariusHelf
    MariusHelf New Altair Community Member
    Well, of course you also have to filter before generating the id, otherwise you get an id for the complete dataset, not only for the current value oO
  • mario_hofmann
    mario_hofmann New Altair Community Member
    Sure thing, there are actually some things I remember from your lessons. ;)
  • dsh_shadi
    dsh_shadi New Altair Community Member
    Thank you Marius Helf,  your reply was so useful :)