Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
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.