Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
My below script has to run to generate qvds for each week .
let vstartdate = '01/05/2015';
let venddate ='31/05/2015';
let vweekstart =(WeekStart(MakeDate(2015,5,01))); // 27 april 2015
let vweekend =(WeekStart(MakeDate(2015,5,31))); //31 may 2015
do while vweekstart<=vweekend
trace vweekstart=$(vweekstart);
week:
NoConcatenate
load
* Resident Base
where SALES_DATE >='$(vweekstart)' and SALES_DATE <=date('$(vweekstart)'+6);
let file = 'weeknew' & date(Date#('$(vweekstart)'), 'YYYYMMDD') & '.qvd';
trace file=$(file);
STORE week into [$(file)];
DROP Table week;
let vweekstart=date(wvweekstart+7);
loop;
It is generating qvds for only first week .It has data for 7days .It has to generate till 31/05/2015 which is the enddate.
Logic help will be appreciated .
Thanks
let vstartdate = '01/05/2015';
let venddate ='31/05/2015';
let vweekstart =(WeekStart(MakeDate(2015,5,01))); // 27 april 2015
let vweekend =(WeekStart(MakeDate(2015,5,31))); //31 may 2015
do while vweekstart<=vweekend
trace vweekstart=$(vweekstart);
week:
NoConcatenate
load
* Resident Base
where SALES_DATE >='$(vweekstart)' and SALES_DATE <=date('$(vweekstart)'+6);
let file = 'weeknew' & date(Date#('$(vweekstart)'), 'YYYYMMDD') & '.qvd';
trace file=$(file);
STORE week into [$(file)];
DROP Table week;
let vweekstart=date(vweekstart+7);
loop;
it is resolved .
let vstartdate = '01/05/2015';
let venddate ='31/05/2015';
let vweekstart =(WeekStart(MakeDate(2015,5,01))); // 27 april 2015
let vweekend =(WeekStart(MakeDate(2015,5,31))); //31 may 2015
do while vweekstart<=vweekend
trace vweekstart=$(vweekstart);
week:
NoConcatenate
load
* Resident Base
where SALES_DATE >='$(vweekstart)' and SALES_DATE <=date('$(vweekstart)'+6);
let file = 'weeknew' & date(Date#('$(vweekstart)'), 'YYYYMMDD') & '.qvd';
trace file=$(file);
STORE week into [$(file)];
DROP Table week;
let vweekstart=date(vweekstart+7);
loop;
Hi,
please use below script
let vstartdate = '01/05/2015';
let venddate ='31/05/2015';
let vweekstart =(WeekStart(MakeDate(2015,5,01))); // 27 april 2015
let vweekend =(WeekStart(MakeDate(2015,5,31))); //31 may 2015
do while vweekstart<=vweekend
trace vweekstart=$(vweekstart);
week:
NoConcatenate
load
* Resident Base
where SALES_DATE >='$(vweekstart)' and SALES_DATE <=date('$(vweekstart)'+6);
let file = 'weeknew' & date(Date#('$(vweekstart)'), 'YYYYMMDD') & '.qvd';
trace file=$(file);
STORE week into [$(file)];
DROP Table week;
let vweekstart =date('$(vweekstart)'+7);
loop;
Regards,
Perumal A