Variable propagation in same query block

@chewxy @dmai any other suggestions I can try out to get this to work?