Simple answer:
You must leave in your block if you are referencing it in another variable using IF… THEN…
Work around (one you already found):
Use the WHERE clause instead with a flag on DATE, see this Reporter FAQ entry.
Drawback:
As of WebI v6.5.1 there is still no WHERE clause for variables I believe.
True, but I provided a work-around in my “Best of Variables” presentation at the conference this year. To replicate this from full client:
Sum<X> Where (<Y> = "Constant")
do this in Webi
Sum(If([Y]="Constant";[X];0))
In my testing so far that has seemed to work, and [X] does not have to appear in the block for the calculation to be performed. It does, obviously, have to be in the query result set.