Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Experts
got a clear idea on what my requirement is :
i have 18 months of qvd data in the a folder with the same file name excpet year and month at the end, we have equal no of columns and name of the columns are also same in each qvd.
here i have to load last 12 months of data from jul-17 to aug -16.
file name is salesdata_20160801.qvd
salesdata_20160901.qvd ........
salesdata_20170601.qvd
salesdata_20170701.qvd
Please help me with the for loop condition as i have no time to explore this.. bit urgent
Much Thanks
Maybe
for each vFile in FileList('..\*.qvd')
TableName:
load
'$(vFile)' as SourceFile,
subfield('$(vFile)','_',-1) as DateN
*
from [$(vFile)] (qvd)
where subfield('$(vFile)','_',-1) <='20170701 ';
next
Maybe
for each vFile in FileList('..\*.qvd')
TableName:
load
'$(vFile)' as SourceFile,
subfield('$(vFile)','_',-1) as DateN
*
from [$(vFile)] (qvd)
where subfield('$(vFile)','_',-1) <='20170701 ';
next
Thanks alot wallo.
can you please elaborate more please include my seanario here in you above solution that would be great.
Bit confused with the logic.
Wallo ,
a small calrification this loop is going to repeat for last 12 months ??
its clear that it will take months on and before 20170701.
What is that DateN indicates in the scritp, Thanks again
It will pull in all the files <=20170701.
DateN is the data at the end of the file name after the underscore.
I picked DateN as the field name but it would really be anything.