Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Michiel_QV_Fan
Specialist
Specialist

For each next. Are the values by default with wildcard?

I load tables with a for each $(variable) = 'line' (and more tables).

The unexpected result is that QlikView also loads tables that partially named line, for instance sbLine is also loaded.

For my application this ins't a showstopper but I'm wondering, is this is normal for QlikView. If so, it there a way to prevent this?

7 Replies
alexandros17
Partner - Champion III
Partner - Champion III

It is not the normal behaviour, could you send me the Whole script?

Michiel_QV_Fan
Specialist
Specialist
Author

No. It is what I posted. Nothing fancy.

alexandros17
Partner - Champion III
Partner - Champion III

Here it is a working piece of script, hope it helps:

let path_Pallet = '..\mYFile_*.xlsx';

for each File in filelist (path_Pallet)
IF(left(right(File,11),4)<=$(currYear)) then
  

PalletInfo:
LOAD
    *

FROM $(File) (ooxml, embedded labels, table is Foglio1);
ENDIF
next File

Anonymous
Not applicable

Use your File name till names are common then *.xlsx

ex if you have files in :\d\Location

and File names as Line1.xls, Line2.xls,Line3.xls and abc_Line1

then use :\d\Location\Line *.xlsx

it will only load Line1.xls, Line2.xls,Line3.xls

ignore abc_Line1


Colin-Albert

Can you post the actual for..each line from your script,

and the actual  From... line within the loop.

This may help see what the actual cause of the problem is

Michiel_QV_Fan
Specialist
Specialist
Author

I figured it out. The for each variable had not replaced the previous variable in the load statement

Colin-Albert

Glad you've fixed it.

It can be useful to add a trace line in to loop to show the value of the variable for each iteration.

trace  Variable = [$(variable)] ;