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.

Not applicable

Looping in script

Hi People,

I'm tring to loop in the script and i'm founding a few erros.

tab1:

Load ID

From (...);

// ID is a filed name with ID codes

Them i want to:

for i=1 to noOfRows('tab1')

               Let a=fieldvalue(ID,i);

Load A

from (..... $(a).xlsx) ;

I'm having problems with this so a also tried to numerate the xlsx files from 1 to 10 and

for i=1 to 10

Load A

from (...$(i).xlsx) ;

and didnt work as well.

Can someone help?

Regards,

Eliano

3 Replies
tresesco
Not applicable

Looping in script

Hello Eliano,

Well, what you tried is clear but what you want is not. can you explain with an exmple what you want?

Regards,  tresesco

Not applicable

Re: Looping in script

Hello Eliano,

The basic syntax that you need to use is:

FOR i = 1 to NoOfRows('tab1')

LET a = fieldvalue('ID', $(i)) ;

// ENTER YOUR CODE HERE

NEXT

In both of your examples you dont have the NEXT statement. Also remember that you need to use the dollar expansion around your variable.

Hope this helps.

Not applicable

Looping in script

Sorry about the delay.

The problem, as you mencioned was with the next operator.

Many thanks for both of you.