I am having the similar requirement where I need to freeze the data for each month.
I understand that at first load , the if condition is false and hence SQL is loaded and stored directly into QVD.
2nd time , SQL is loaded and it gets into the if condition and creates a table with MAXIMUM FREEZE DATE which is nothing but TODAY. It is stored in the variable.
and concatenated with previous data available in QVD.
So, we might have the duplicates in this case right.