Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I want to get last two years record from qvd ans store it in another qvd.
Thanks,
Lawrance
May be like this
LOAD * FROM ARCHIVO.QVD (QVD)
WHERE Year(DateField) >= Year(Today()) - 2;
Regards
(Do you have a datefield or year field in your old qvd just use it and try like below?)
TWOYEAR:
LOAD *
FROM yourpath\yourqvdname.qvd(qvd)
WHERE Year >=2015;
STORE TWOYEAR INTO yourqvdpath\yournewqvdname.qvd(qvd);
May be like this
LOAD * FROM ARCHIVO.QVD (QVD)
WHERE Year(DateField) >= Year(Today()) - 2;
Regards
To keep the qvd load optimized you can also do something like this:
//Assign variables for start date and end date.
let vEndDate=num(today());
let vStartDate=num(yearstart(today(),-2));
//Assign variable for number of days between start and end dates.
Let DayCount =$(vEndDate)+1-$(vStartDate);
DateFilters:
LOAD
date($(vEndDate)+1-recno(),'MM/DD/YYYY') AS NameOfYourDateField
AUTOGENERATE $(DayCount);
Data:
Load *
from yourpath\yourqvd.qvd (qvd)
where exists(NameOfYourDateField);
STORE Data INTO yourpath\yournewqvd.qvd(qvd);
Drop table DateFilters;