Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

load data into qvds for each week

Hi All,

I have two years data .i have to store the data into weekly qvd's. let's assume i have if i have  two months data  and i need to break the data into weekly qvds for every week.And qvd name should be the week start name.

Any help will be appreciated.

20 Replies
Anonymous
Not applicable
Author

Yeah!!

but i couln't populate data into qvds ,it might be my path problem

Anonymous
Not applicable
Author

Hi

The above code is giving weekstart of 1st year 1st month .it is giving the same weekstart for all the months.

But i need weekstart for every week .

Thanks

maxgro
MVP
MVP

The script I already posted is in the attachment

I tried, reload and I get the s.qvd (test data) splitted in weeks qvd

example w_20150126.qvd has dates from 26 jan to 01 feb

1.png

Anonymous
Not applicable
Author

Hi

Thanks for your solution. Its working fine .It is breaking into week qvds.But the problem is when i am storing it into qvds is throwing error table not found.I have checked my path its correct .

weekstart:

load * Resident Data

Where SALES_DATE >='21/01/2015' and SALES_DATE <='22/06/2015';

let file = date(Date#('$(vweekstart)'),'YYYY/MM/DD');

TRACE file =$(file);

STORE weekstart into [$(mypath)/$(file)].qvd(qvd);

DROP Table weekstart;

Thanks

maxgro
MVP
MVP

maybe table not found is weekstart

add a noconcatenate

weekstart:

noconcatenate load * Resident Data

Where SALES_DATE >='21/01/2015' and SALES_DATE <='22/06/2015';

let file = date(Date#('$(vweekstart)'),'YYYY/MM/DD');

TRACE file =$(file);

STORE weekstart into [$(mypath)/$(file)].qvd(qvd);

DROP Table weekstart;

Anonymous
Not applicable
Author

I used noconcatenate but it is not giving values week by week and moreover it script execution is failing .

maxgro
MVP
MVP

could you post your script and your source data (qvd)?

Anonymous
Not applicable
Author

This is the error i am facing .

Anonymous
Not applicable
Author

Hi ,

My qvd is too large to attach.

But my script is below

Data:

LOAD

SALES_DATE,

From

[./QVD/SALES.QVD](qvd);

let vweekstart =WeekStart('21/01/2015');

let vweekend =WeekStart('22/06/2015');

do while vweekstart <= vweekend

trace vweekstart=$(vweekstart);

week:

load * Resident Data

Where SALES_DATE >='21/01/2015' and SALES_DATE <='22/06/2015';

let file = date(Date#('$(vweekstart)'),'YYYY/MM/DD');

TRACE file =$(file);

STORE week into [.\QVD\$(file).qvd];

DROP Table weekstart;

let vweekstart=date(vweekstart+7);

LOOP;

Digvijay_Singh

DROP TABLE Weekstart will also fail, it should be 'week' instead.