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

in FOR ... NEXT loop how can I refer to above loaded value?

Hi All,

in FOR ... NEXT loop how can I refer to above loaded value?

//I load one dimension - D1 with one value only - 10

LOAD

     Dim1

From MasterTable;

//I need to use the above loaded value set iterations limit

FOR i = 0 TO 10

LOAD

     D2

FROM Table'$(1)';

NEXT

Thank you,

Przemek

1 Solution

Accepted Solutions
Not applicable
Author

Hello Przemek,

After loading the value you can store it in a variable like this:

MasterTable:

Load Dim1 from ...;

let vDim = Peek('Dim1', 0, 'MasterTable');

and then you can use it in your script:

for i = 0 to $(vDim)...

Hope this helps.

View solution in original post

2 Replies
Not applicable
Author

Hello Przemek,

After loading the value you can store it in a variable like this:

MasterTable:

Load Dim1 from ...;

let vDim = Peek('Dim1', 0, 'MasterTable');

and then you can use it in your script:

for i = 0 to $(vDim)...

Hope this helps.

Not applicable
Author

Exactly, thank you jp.