Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

FOR - NEXT loop next in load scripts

I'm trying to make load scripts including for-loop nested as below.

But it doesn't wok.

Is there anyboy who helps me to solve this?

Thank you for your cooporation,

For $(j)=1 to 3

LET i=1;

For $(i)=1 to 44

if j=1 or (j=2 and (i=1 or i=2 or i=4 or i=5 or i=20)) then

NTAB_temp:

LOAD

$(j) as j_count,

    $(i) as i_count;

SQL SELECT *

FROM "sample_database".dbo.TABLEA;

endif

LET i=$(i)+1;

Next;

LET j=$(j)+1;

Next;

Jun from TOYKO

1 Reply
tamilarasu
Champion
Champion

Hi Jun,

I am not sure what you are trying to achieve. Try this,

For j =1 to 3

For i=1 to 44

if j=1 or (j=2 and (i=1 or i=2 or i=4 or i=5 or i=20)) then

NTAB_temp:

LOAD

$(j) as j_count,

    $(i) as i_count;

SQL SELECT *

FROM "sample_database".dbo.TABLEA;

endif

Next

Next