Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
viveksingh
Creator III
Creator III

Split Huge QVD into Day wise QVD

Hi All,

I have a huge QVD which is around 20GB with 2 Years of data. I want to split the QVD into Daywise. One day date to be load into one QVD. ex:ABC_QVD_20191220, ABC_QVD_20191221, ABC_QVD_20191222.....

Using For loop, I'm able to identify the mindate and maxdate, But my for loop is not wrking. 

 

 

6 Replies
viveksingh
Creator III
Creator III
Author

any inputs on this please

Kushal_Chawda

you can do something like below

let vQVDPath ='lib://QVDPath/Qvd/';

let vStoreQVDPath ='lib://StoreQVDPath/Qvd/';

let vSartDate = floor(MakeDate(2018,1,1));

let vEndDate = floor(Today());

for i= vSartDate to vEndDate

let vDate = Date($(i),'YYYYMMDD');

Data:
Load *
FROM [$(vQVDPath)ABC_QVD.qvd]
Where Floor(YourDateFieldInQVD)=$(i);

Store Data into '$(vStoreQVDPath)ABC_QVD_$(vDate).qvd';

Drop Table Data;

Next

let i=i+1;

 

Note:  Change variables according to your requirements. 

atoz1158
Creator II
Creator II

Hi

Below is the script that we used to split a large QVD, you will of course need to adapt it to your QVD and field names, also the where clause will need changing and where you are storing the daily QVD files.

 

vMinDate = Floor(MakeDate(2014,11,10));

vMaxDate = Floor(MakeDate(2016,06,09));

For i = vMinDate TO vMaxDate
Let vQVDDate = Date($(i),'YYYYMMDD');
Readings:
NoConcatenate
LOAD *
FROM Meter_Readings.qvd (qvd)
WHERE Floor(ReadingDate) = $(i);
If NoOfRows('Readings') > 0 Then
STORE Readings into QVD\Meter_Readings_$(vQVDDate).qvd (qvd);
ENDIF
DROP Table Readings;
Next i

Regards

Adrian

viveksingh
Creator III
Creator III
Author

Thanks for the reply. I tried the same way. but my for loop is not working. Below is the that I used.

Sales:

LOAD 

* from Sales_QVD(qvd);

Let  vMin_Date=Date(Min(FLoor(FilterDate)),'YYYYMMDD') ;
Let  vMax_Date=Date(Max(FLoor(FilterDate)),'YYYYMMDD') ;

For i = vMin_Date to vMax_Date

data:

Load *

resident sales where date=vMin_Date;

store data into sales_$(vMin_Date).qvd(qvd);

next

 

atoz1158
Creator II
Creator II

Hi

 

Try using the following code which you should not need to change

 

Sales:

LOAD

* from Sales_QVD(qvd);

Let vMin_Date=Date(Min(FLoor(FilterDate)),'YYYYMMDD') ;
Let vMax_Date=Date(Max(FLoor(FilterDate)),'YYYYMMDD') ;

For i = vMin_Date TO vMax_Date

Let vQVDDate = Date($(i),'YYYYMMDD');

data:
NoConcatenate
LOAD *
resident sales where date = $(i);

If NoOfRows('data') > 0 Then
STORE data into sales_$(vQVDDate).qvd (qvd);
ENDIF

DROP Table data;

Next i

Regrads

Adrian

Brett_Bleess
Former Employee
Former Employee

Vivek, did Atoz's latest post get you what you needed?  If so, do not forget to return to your thread and use the Accept as Solution button on the post to mark that as the solution, which will give Atoz credit for the help and let other Community Members know that worked.  If you need further help, leave an update post.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.