Adding Previous Row's data to current row

Hi all!

I have created a datatable (DT!) and using a “for each row” to loop through the table. I am looking to see if the reporting level matches the criteria in this case “level 1” if the reporting level matches the criteria the agency name will be brought over from the first cell in the same row. However if the reporting level does not match the criteria then the row should be assigned the value for the column in the previous row.

thanks!

Hi @JamesL

Check this if condition as

Row(“Agency & Subagency name”). ToString.contains(“Agency”)

Assign row(“level1”). ToString=“Agency1”)

Do it like that for conditions

Thanks
Ashwin.S

Hi @AshwinS2

thanks for your quick reply!

unfortunately i’m not sure if that will help. I need the values to be dynamic so that when the IF statement is not met then the value from column “Level 1” in the row above should cascade down to the row where the IF statement is being checked. the loop should continue looping through and assigning the value from the column “Level 1” in the row able until the if statement is met.

below is where i assign the cell once the IF statement is not met.
image

more to follow. only one image to a post lol!

here are the variables used in the calculation

thanks!