Survey banner
The Dataiku Community is moving to a new home! Some short term disruption starting next week: LEARN MORE

Replace value based on the previous/next value in the column

Level 1
Replace value based on the previous/next value in the column


I have a fixed price of the current quarter. Then I have the percentage difference based on the other input (raw to raw). It looks like this more or less:



2A YYYYYYY01.04.2020 -0.05
3A XXXXXX01.07.2020 


5B ZZZZZZ01.04.2020 -0.09
6B VVVVVV01.07.2020 


I want to get the YYYYY value by subtracting  Price of ID 1 by percentage DIff of ID 1 ( YYYY then wound be 2970).

Then to get XXXXX value I want to do the same but with price YYYYYY and so on.


Operating system used: Win 10

0 Kudos
2 Replies


Welcome to the Dataiku community.

If I were trying to do something like this with visual recipes and not code, I’d be taking a look at the window recipe to get data from prior rows onto the current row.  Once I had my lag values on the current row, I’d likely use a visual prepare recipe to add a formula step to do the calculations.   

These Dataiku academy course covers these two recipes in these two courses.

The basic ideas are covered in this course: 

More details are provided here with some hands on  exercises.

And here is something more on formulas

Hope this helps please let us know how you are getting on with your project.  




0 Kudos
Level 1

Thanks Tom.

What you described I did to get those month-2-month percentage difference since this is based on other column input with all values filled in.

Now I need to get the same for one fixed value only where all other are blank. Move that value to the next raw and same again. 

My data is more than 50 rows with dates per each item. 


I thought maybe there is a formula I could use to achieve it?

0 Kudos