I have a code in my QlikView script doing the following:
- Load an overview table with 15 serial_numbers (some text, some purely numeric) and the respective text;
- Loop from 1 to 15 (there are 15 SN) and load one SN on each iteration;
- Set a variable with the current SN;
<=> At least that's what it is supposed to do.
=> The variable should then be used (still within the Loop) to load one of 15 worksheets, all of which have the same structure with similar data.
I can see afterwards in a listbox that all 15 SN are loaded, one at a time. The variable, however, returns just NULL values.
Might it be that I cannot create variables in a loop at all? If so, how can I achieve this effect (within every loop_iteration, repeat a LOAD statement for the respective SN, which is in the sheet_name)?`
From another software I know I had to initiate variables before a LOOP to be able to use them, but that doesn't seem to work...
I have a somewhat simplified LOOP construction, I will post it after this. Yours does look better, it is flexible as to the nr. óf rows. I will replace that. Do I have to specify the table and row with the PEEk fct to fill my variable? At that time, there is only one field of that name.
Here is the code I am currently using:
Übersicht_SN: LOAD A as SN, B as Bezeichnung, RecNo() as SN_Ct FROM (ooxml, no labels, header is 3 lines, table is Übersicht) WHERE NOT ISNULL (A);
FOR i = 1 TO 15
Test_Counting: LOAD SN as SN_test RESIDENT Übersicht_SN WHERE SN_Ct = $(i) ;