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

Save field value in a variable

Hello,

I have some table:

Some_table:

LOAD * INLINE [

  ID, Num

  1, 2

  2, 5

  3, 6

  4, 3

  5, 1

  6, 2

  7, 7

  8,  8

  9, 9

  10, 5

];

and another table with maximum field:

LOAD

  Max(Num) as Max_ID

Resident Some_table;

Now, I want to save the value at the Max_ID field so i can run loop like this:

for i=1 to (The variable that containing the Max_ID value)

Sentiment:

     LOAD

               ID as Id_Max_ID,

                '$(i)' as Num_of_Max_ID

     Resident Some_table

next

My big issue is to save the field value into a variable.

Thank you!

1 Solution

Accepted Solutions
Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Hi,

LET vVariable = Peek('Max_ID', 0, 'Some_table');

Help users find answers! Don't forget to mark a solution that worked for you!

View solution in original post

3 Replies
Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Hi,

LET vVariable = Peek('Max_ID', 0, 'Some_table');

Help users find answers! Don't forget to mark a solution that worked for you!
CELAMBARASAN
Partner - Champion
Partner - Champion

You could use Peek or FieldValue function

Ex:

LET vMaxID = Peek('Max_ID');

varaprasad0816
Creator II
Creator II

Correct Answer

I have executed