Home › Forums › kdb+ › Accessing previous calculated value from a column in current row › Re: Accessing previous calculated value from a column in current row
-
Hello,To modify the table in place, pass it by name (i.e. `t).
q)t:([]c1: 1 2 3 4 5 6 7 8 9) q)update c2:((prev(c1)+10) + c1)%2 from `t `t q)update c2:((prev(c2)+10) + c1)%2 from `t `t q)t c1 c2 -------- 1 2 3 9.75 4 10.75 5 11.75 6 12.75 7 13.75 8 14.75 9 15.75