Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

week qvds

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

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

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;

View solution in original post

3 Replies
Anonymous
Not applicable
Author

it is resolved .

Anonymous
Not applicable
Author

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;

perumal_41
Partner - Specialist II
Partner - Specialist II

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