generate a new (complex) Attribute

SimonW18272
SimonW18272 New Altair Community Member
edited November 2024 in Community Q&A
Hey everyone,

I want to get a new attribute which is quiet complicated (atleast I think its the case)

I got the follwoing table with the data set in black and I want to get a new variable which indicates if the last case (look at date) with the same ID was a yes or no.

Imagine the data would be if a person (ID) came to the doctors appionted was noted. Now I want to generate an attribute if the person (ID) came to the last  appointment (before this one)or not. How can I enable this in Rapidminer because its quiet complex for me. Hope you get my question with the example


Tagged:

Answers

  • MartinLiebig
    MartinLiebig
    Altair Employee
    Hi,
    seems like you can first use lag and then something like:
    if(date_before(Date-1,Date),"Yes,"No")
    with generate attributes
    or so?

    Best,
    Martin
  • BalazsBaranyRM
    BalazsBaranyRM New Altair Community Member
    Simple lag won't be enough if multiple patients are in the data. The right approach would be "Loop values" on the ID (or better a nominal copy of it for Loop Values), inside the loop filtering for the current ID, and doing the lag there. 
  • MartinLiebig
    MartinLiebig
    Altair Employee
    Oh, true.
    I usually recommend to use Group Into Collection + Loop Collection over Loop Values for this though.

    BR,
    Martin