Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am new to qlik sense and i am trying to use below do loop to create a simple table. But table is not getting created although code is running successfully. Can someone please explain why table is not getting created.
table:
let a=1;
do while (a<=5)
load a;
a=a+1;
loop;
As below, the table creation must be within the loop, not outside the loop
1) Using Do While
let a=1;
Do while a<10
Table:
LOAD $(a) as field
AutoGenerate 1;
Let a=a+1;
Loop
1) Using only start and end variables
LET vstart = 1;
LET vend = 10;
Table:
lOAD $(vstart)+ITERNO()-1 as field
AutoGenerate 1
WHILE $(vstart)+ITERNO()-1 <= $(vend);
As below, the table creation must be within the loop, not outside the loop
1) Using Do While
let a=1;
Do while a<10
Table:
LOAD $(a) as field
AutoGenerate 1;
Let a=a+1;
Loop
1) Using only start and end variables
LET vstart = 1;
LET vend = 10;
Table:
lOAD $(vstart)+ITERNO()-1 as field
AutoGenerate 1
WHILE $(vstart)+ITERNO()-1 <= $(vend);
Hi Vineeth,
Thanks for your reply and your solution is working fine
Table creation outside the loop is also working fine. Does placement of tablename: really make difference?
Table1:
let a=1;
Do while a<10
LOAD $(a) as field
AutoGenerate 1;
Let a=a+1;
Loop