store a value for next few rows

what is the easiest way to store a value of a variable from the current row for conditional processing the same variable in the next few rows?

Have you seen the Lag Column node? This may do just what you need.