Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

michielvandegoo
Valued Contributor

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?

Tags (1)
7 Replies

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

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

michielvandegoo
Valued Contributor

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

No. It is what I posted. Nothing fancy.

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

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

balkumarchandel
Valued Contributor II

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

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


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

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

michielvandegoo
Valued Contributor

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

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

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

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)] ;

Community Browser