Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
How to load the latest qvd from the folder.
ex: i have qvds in that folder like:
sample_20190331_0.qvd
sample_20190331_1.qvd
sample_20190331_2.qvd
sample_20190430_0.qvd
sample_20190430_1.qvd
sample_20190530_0.qvd
sample_20190530_1.qvd
i want to load that particular the month wise Latest number .qvd ,not all,into my app.
like for March i want to load sample_20190331_2.qvd, for April i want load sample_20190430_1.qvd
how to achieve this?
Hi,
you can use this script:
for each file in filelist('..\..\Support\Daten\sample_*.txt')
Temp:
load
FileName() as file,
subfield(FileBaseName(),'_',2) as month,
subfield(FileBaseName(),'_',3) as version
from '$(file)';
next
left join (Temp)
load
month,
max(version) as maxversion
resident Temp
group by month;
Filestoload:
load
file
resident Temp
where version = maxversion;
for loop = 0 to NoOfRows ('Filestoload')-1
let loadfile = peek('file',$(loop),'Filestoload');
Data:
load
*
from ..\..\Support\Daten\'$(loadfile)'
;
next
drop table Temp;
drop table Filestoload;
Add STORE FinalTable into xyz.qvd (qvd); after DROP statement at the end.
Hi,
This is giving me proper output I am able to retrieve the latest reloaded file but now I also want to load the 2nd last file and concate with each other.
Let me know how can i get the second latest file also...
Thanks in advance.