I have a problem here now. There is just one file in this instance, "SOFA_1". So I want to load this in a loop.
To know the exact fieldnames - I want to avoid the * in a LOAD - I loaded the table as a standalone in a separate app.
There, the table loads quite normally and there is a field called "Werk_unsauber".
=> So I know the name of all the fields and I can write my LOAD into the loop, taking care to get a specific order of fields and to use the AS option every time - I want to append the LOAD to another one later, so the names have to be equal.
Still, I kept getting an error "Field not found >Werk_unsauber<
I copied it over from the standalone_LOAD several times to make sure there was no typo.
Then I just tried loading the file in the loop with an * and just look what the fields are like.
<=> now I get some xml stuff - describing the correct record, though.
I cannot make head or tail of this - the file is definitely qvd, not txt, my searchmask says *.qvd, and I have a counter_variable made up of part of the searchmask because one field has that as a suffix.
Can you help me there?
P.S.: I have used Filename() and confirmed that the code is definitely loading the correct file - and in my separate test_app, it's loading all normal ...
P.P.S.: Must be that * - when I do a LOAD * in the test_app, I get the same crap. When I type up every fieldname instead, it's fine...
It looks like that is a txt file - but how can that be?
sometimes there are error-messages which are not quite true because they shows a consequential error and not the real reason. I have had already such "Field not found" errors and the reasons was errors with the file-path or tablename or it was missing the fileformat like a.qvd (qvd). Maybe you could use "set ErrorMode" and ScriptError to find out what goes wrong.
There is one field in those tables I want to load in the loop - now I have an example_scenario where there are two. They both have the nr. of the iteration where they were created as a suffix, so they are named
I want to load them in a loop and I have to generate that suffix to get the fieldname right.
=> So I have it like
FOR each File in FileList()
LET v_Ctr = MID($(File), 6, 1);
(Ofcourse, there is the LOAD inside the loop, but that's not the problem. Seemingly QlikView correctly sets that counter to 1 for the file 'SOFA_1.qvd' and loads it all right - but in the second iteration, it does not set it to 2 (for 'SOFA_2.qvd'), but the counter remains at 1 and the LOAD consequently fails.