If I understood your question, you need to create a table with previous quarters based on quarter values.
The following script:
Load * Inline
if (Quarter=1,Null(),IterNo()) as [Previous Quarter]
While IterNo() <=Quarter;
drop table x;
where Quarter <> [Previous Quarter];
drop table y;
Gets the following output:
Since you now have the Quarter and Previous Quarter mapped out, now you could do the if statement on the new field.
Is that what you need?