Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
evgeniyita
Contributor

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
Valued Contributor

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

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

View solution in original post

4 Replies
micheledenardi
Valued Contributor

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

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;

evgeniyita
Contributor

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

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
Valued Contributor

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

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

View solution in original post

evgeniyita
Contributor

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

Thank you very much. It's a nice solution