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: 
rsdhavle
Creator III
Creator III

Storing multiple values in a variable from For loop

I have one for loop for values i = A1 to A100 . I am using peek function and storing 1 value at a time in a variable V1 = A1

and then passing this variable into another table to retrieve certain values.

Instead of 1 value at a time of i need to pass 'i' values V1 = A1,A2,A3,A4..  ..etc in a variable V1 comma separated format how can i achieve that in this case?

Labels (1)
12 Replies
petter
Partner - Champion III
Partner - Champion III

If you find any or all of the replies or suggestions helpful please mark them with a like as it seems to be the only way you credit anyone on this community site except from tagging with answered. Just writing "thanks" or anything verbally doesn't give people credit technically although they of course appreciate that too... 🙂 

rsdhavle
Creator III
Creator III
Author

I have one question with this .i understand for loop will impact performance but this query gives me 100 values in multiple rows however when i pass this accounts values in the variable i will have to pass one value(consisting of 100 ) accounts at a time. So i will need loop right passing 1 row at a time?

petter
Partner - Champion III
Partner - Champion III

Correct - so you will not avoid the for loop entirely but you speed up the generation of the variables enormously.