Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Sib
Contributor II
Contributor II

Loading a table inside a For Loop

I have a need where with in a Loop construct i need to create a table to be used later. Below is sample representation of that code. I looked thru all past post on this and tried various suggestion in post but not sure why it is not working for me.

Past post had suggested to create a empty table like i did here, then within loop just concatenate data to it. However at the end of this run table is still empty.

Any suggestion is welcomed.

 

AnalysisTable:
LOAD * Inline
[ID, ID1, ID2];

For j = 1 to 10
LET v1 = (j * 2);
LET v2 = ((j * 28) + 10) / 14;
LET v3 = j + $(v1) - $(v2);
Concatenate(AnalysisTable)
LOAD $(v1) as ID
,$(v2) as ID1
,$(v3) as ID2
;
Next j

1 Solution

Accepted Solutions
Or
MVP
MVP

AnalysisTable:
LOAD * Inline
[ID, ID1, ID2];

For j = 1 to 10
LET v1 = (j * 2);
LET v2 = ((j * 28) + 10) / 14;
LET v3 = j + $(v1) - $(v2);
Concatenate(AnalysisTable)
LOAD $(v1) as ID
,$(v2) as ID1
,$(v3) as ID2
Autogenerate(1)
;
Next j

View solution in original post

2 Replies
Or
MVP
MVP

AnalysisTable:
LOAD * Inline
[ID, ID1, ID2];

For j = 1 to 10
LET v1 = (j * 2);
LET v2 = ((j * 28) + 10) / 14;
LET v3 = j + $(v1) - $(v2);
Concatenate(AnalysisTable)
LOAD $(v1) as ID
,$(v2) as ID1
,$(v3) as ID2
Autogenerate(1)
;
Next j

Sib
Contributor II
Contributor II
Author

Thank you that worked.