Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
any inputs on this please
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.
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
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
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
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