Generate Attribute depending on 2 values in previous rows

MPB_MPB_ Member Posts: 45 Guru
edited November 2019 in Help
Hi there,

I already searched the forum but did not find anything very helpful.

Let´s say I have some easy sales-data in an example-set like this:

Week | Product | UnitPrice | Unit_Sales
01_19| Beer_A | 0.99          | 10
02_19| Beer_A | 0.85          | 20

I would like to generate a new Attribute which:

  •  either gives the price of a product of the last week
  • or already calulates the price-difference from the previous week to the actual row/week

Is that even possible with the operator  Generate Attribute?

Best regards and have a nice day :)

Best Answer


  • Options
    MartinLiebigMartinLiebig Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,517 RM Data Scientist
    you most likely want to use first the Lag operator and combine this with Generate Attributes.

    - Sr. Director Data Solutions, Altair RapidMiner -
    Dortmund, Germany
  • Options
    MPB_MPB_ Member Posts: 45 Guru
    Hi Martin, thank you for your answer.

    Could you please explain that? How exactly would you lag this and how would you combine that with generate Attributes?
  • Options
    MPB_MPB_ Member Posts: 45 Guru
    Thank you very much Sir!!!!
Sign In or Register to comment.