Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Iam trying to Loop inside a Load until it has reached a specific number.
Because i have a table with a lot of Columns (Artikel.L1 --> Artikel.L20)
So basically this is what i have tried,
for i=1 to 20
LOAD
Key&'-'&Artikel.L$(i) as Artikel$(i)
Resident FullTree;
Next i;
It generate seperate Tables for every step.
but i want them in one single Table. How do i achieve this?
Thanks for your help!
for i=1 to 20
if i=1 then
table1:
LOAD
Key&'-'&Artikel.L$(i) as Artikel$(i)
Resident FullTree;
else
concatenate (table1)
LOAD
Key&'-'&Artikel.L$(i) as Artikel$(i)
Resident FullTree;
end if;
Next i;
for i=1 to 20
IF i > 1 THEN
CONCATENATE
ENDIF
LOAD
Key&'-'&Artikel.L$(i) as Artikel$(i)
Resident FullTree;
Next i;
for i=1 to 20
if i=1 then
table1:
LOAD
Key&'-'&Artikel.L$(i) as Artikel$(i)
Resident FullTree;
else
concatenate (table1)
LOAD
Key&'-'&Artikel.L$(i) as Artikel$(i)
Resident FullTree;
end if;
Next i;
solution 1:
MyTab:
Select '' as fld1 .... '' as fldn;
For i=1 to 20
concatenate (MyTab)
Load ....
next
solution 2:
For i=1 to 20
myTab_$(i)
Load ....
next
For i=1 to 20
load ... resident myTab_$(i);
next
let me know
Thanks Sergey,
It worked!