Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am loading all the QVDs present in a folder. The QVDs have year suffixed to it's name. e.g. Sample_2012.qvd, Sample_2013.qvd and so on...
I have to store latest two years qvds in one folder and the QVDs prior to 2 years in another folder. How do i do that?
Hi Asma
Below is the code which will work for you
Temp:
load Distinct FileBaseName() as Filename
from
C:\Users\Desktop\Temp\*.qvd(qvd);'This path is where QVD's are placed
For i = 1 to NoOfRows('Temp')
let filename=FieldValue('Filename',$(i));
if(right('$(filename)',4)='2014') then
$(filename):
load
* From C:\Users\Desktop\Temp\$(filename).qvd(qvd);
let path='C:\Users\Desktop\Temp\currentYear\'&'$(filename)'&'.qvd(qvd)';
store $(filename) into $(path);
drop table $(filename);
ELSEIF(Right('$(filename)',4)<2014)then
$(filename):
load
* From C:\Users\Desktop\Temp\$(filename).qvd(qvd);
let path='C:\Users\Desktop\Temp\previousYear\'&'$(filename)'&'.qvd(qvd)';
store $(filename) into $(path);
drop table $(filename);
end if
next
Regards
Harsha