Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Rotun
Contributor
Contributor

Is it possible to use a "for each" loop to insert data into a table instead of typing it by hand?

Hi everyone,

I have a problem with using a "for each" loop. I would like to insert the list values from an already existing list.

Example:

 

for each stock1 in 'A', 'B', 'C';
trace $(stock1);
next;

 

If I generate a table:

 

stock:
load * inline [stock1
A
B
C];

 

I can't  use the field stock1 in the "for  each" loop.

Thanks!

Labels (2)
1 Solution

Accepted Solutions
Rotun
Contributor
Contributor
Author

Hi guys,

I solved it by myself, I had to use the FieldValueList() statement, in this way:

stock:
load * inline [stock1
	         A
	         B
                 C];

for each stock1 in FieldValueList ('stock1'); 
trace $(stock1);
next;

 

Thank you all the same

View solution in original post

1 Reply
Rotun
Contributor
Contributor
Author

Hi guys,

I solved it by myself, I had to use the FieldValueList() statement, in this way:

stock:
load * inline [stock1
	         A
	         B
                 C];

for each stock1 in FieldValueList ('stock1'); 
trace $(stock1);
next;

 

Thank you all the same