The following sample script shows how you can extract one year data from the table of data for several years. Hope this helps you write the script for your application.
LET vStartDate = Num(Date#('01/01/2006','MM/DD/YYYY'));
LET vEndDate = Num(Date#('12/31/2011','MM/DD/YYYY'));
AllData:
LOAD Date($(vStartDate) + IterNo() - 1) as Date
,Ceil(rand()*100) as Sales
AutoGenerate 1
While $(vStartDate) + IterNo() <= $(vEndDate);
RequiredData:
NoConcatenate LOAD * Resident AllData Where Date >= AddYears(Today(),-1) and Date <= Today();