Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to use a nested for next loop to read multiple qvd having a daily signiture like ...YYYY-MM-DD.qvd.
How do I access the variables from the loop correctly to create a string that I can use to read qvd from.
for each vJahr in qvdJahr
for each vMonat in qvdMonat
for each vTag in qvdTag
vFromString = $(vPath) & '\QDatei_' & '$(vJahr)' & '-' & '$(vMonat)' & '-' & '$(vTag)' & '.qvd';
Load
*
Fm $(vFromString) (qvd);
next
next
next
The script above stopps with an error message saying:
"Fehler beim Öffnen der Datei 'D:\QDatei_--.qvd' The system cannot find the file specified."
So the content of the variables qvdJahr, qvdMonat, qvdTag are not placed in the string whereus
the variable vPath is there.
Michael
Hi Michael,
how did you define qvdJahr, qvdMonat and qvdTag variables?
regards
Hi
here's the code:
qvdFiles:
FIRST 1 LOAD
filedir() as qvdPath
, filename() as qvdFilename
, mid(filename(),13,4) as qvdJahr
, mid(filename(),18,2) as qvdMonat
, mid(filename(),21,2) as qvdTag
FROM [$(vPath)\QDatei*.qvd] (qvd);
regards
Michael
Michael,
the for .. each needs to have the values as a list: 2010, 2011, 2012
So, this will not work. Alternatively you can loop over the table:
LET rows = NoOfRows('qvdFiles');
For i=1 to $(rows)
let vQvdJahr=peek('qvdJahr', $(i), 'qvdFiles');
etc.
next
- Ralf
In this scenario how can i find the NoOfRows in the load statement? Something like as discussed in the below post!