0 - 2 of 2 tags for Windowing function

I have a table t in which there are various attribute like product,year,qtr,month,sale. I have to calculate the avg_qtr sale and show previous avg_qtr sale. I have used windowing function to show previous avg_qtr sale. I have read about lag but here it is not possible to use as it is not fixed after how many rows it will be repeated.

Hi,  I am trying to run the below query, in vain. I was able to get the results by using a different logic.
However I am not able to understand why my query for search didn’t work, while my query for sales worked (they are both essentially the same query with different column names)