Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to use a loop through tabs in the load script editor

Hello guys,

I've got few tabs in the QV load script editor which I need to load one by one. And I need to use a loop through these tabs.

I don't want to keep all code in one tab. Is it possible to use the same loop through the existing tabs ?

With my best regards,

Evgeniy

1 Solution

Accepted Solutions
micheledenardi
Specialist II
Specialist II

Ah ok... sorry...

i think the best approach is to use sub() and call()...  so:

Tab1:

sub tab1

     //your tab1 script

end sub


Tab2:

sub tab2

     //your tab2 script

end sub

Tab3:

For i = 0 to N

     Call tab1;

     Call tab2;

next

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

4 Replies
micheledenardi
Specialist II
Specialist II

Maybe something like this:

TableName:

Load * Inline [

Table

Tab1

Tab2

Tab3

Tab4

Tab5

Tab6

];

For i=0 to NoOfRows('TableName')-1;

    let vTable =peek('Table',i,'TableName');

    '$(vTable)':

    SELECT

    *

    from $(vTable);

next

drop table TableName;

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.
Anonymous
Not applicable
Author

thanks for the quick response but I mean ...I need something like this:

Tab1:  //a tab in the load script editor (not a table)

For i = 0 to N

Table1:

load * from ...

Tab2:

Table2

load * from...

NEXT

micheledenardi
Specialist II
Specialist II

Ah ok... sorry...

i think the best approach is to use sub() and call()...  so:

Tab1:

sub tab1

     //your tab1 script

end sub


Tab2:

sub tab2

     //your tab2 script

end sub

Tab3:

For i = 0 to N

     Call tab1;

     Call tab2;

next

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.
Anonymous
Not applicable
Author

Thank you very much. It's a nice solution