Redshift- How to use previous row's calculations in current row
You need recursive common table expresion , feature not available in redshift , try another server for this or use a loop . Lag is not referring computed columns is not helpful in this case

On another sql server it should look like this : 

with cter as (
select r,f , wk , bi+r-f as endinv from test_1test where wk = 1 
union all 
select t.r, t.f , t.wk, c.endinv + t.r -t.f as endinv from test_1test t inner join cter c on t.wk -1  = c.wk 
)
select * from cter order by wk