One of the things to remember with these time calculations is the target periods and source periods are not always the same. IF you want to calculate the YTD average and store it in a new varaibale in the current month you need something like this:
set period Jan - Apr
calc var2 = average(var1) for Apr
I don't have a working PAS system in front of me so the syntax will be wrong. However the "for Apr" is telling it to restrict the target to a single month.
The lag also requires this approach or the early months pick up zeros from the non-selected period.