Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi - I'm need to import a range of data from various QVDs that is less than a certain date, defined by a variable. The script works when I bring in a singular file, but not when I import multiple files.
Variables :
LET vMinDate = Date(Today()-7,'YYYYMMDD'); //Used elsewhere in the script
LET vMinDate2 = num(vMinDate); // Used for this query
So this works and brings in only August data prior to the vMinDate variable :
YHMN:
Load *
where [Date] < '$(vMinDate2)';
Load * from $(vQVDDirectory)$(vYHMNFile)20150801_20150830.qvd (qvd) // This is a specific file with August data
This doesn't - it runs but brings in all data up to whatever the lastest data is in the QVDs(in this case yesterday).
YHMN:
Load *
where [Date] < '$(vMinDate2)';
Load * from $(vQVDDirectory)$(vYHMNFile)*.qvd (qvd) / This loads all files including the one specified in the query above
All QVDs have been created using the same extraction script and are just the same data broken into months.
So what do I need to add or adjust to make the second script run ? This is what I need - all historical data but only up to the variable date (for explanation why, the data after this date will be replaced with a new data run each day).
Regards,
Dave
Hi Dave,
Try like this
Temp:
Load * from $(vQVDDirectory)$(vYHMNFile)*.qvd (qvd)
YHMN:
Noconcatenate
Load *
RESIDENT
where [Date] < '$(vMinDate2)';
DROP TABLE Temp;
Regards,
Jagan.
Hi Dave,
Try like this
Temp:
Load * from $(vQVDDirectory)$(vYHMNFile)*.qvd (qvd)
YHMN:
Noconcatenate
Load *
RESIDENT
where [Date] < '$(vMinDate2)';
DROP TABLE Temp;
Regards,
Jagan.
Works perfectly, thanks 🙂