Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Could you please help me with this peace of script:
For i = 1 To $(LOOP_COUNTER)
if i = 1 Then SET SelectORJoin = 'Sql Select';
else SET SelectORJoin = 'Join (Table1) Select';
.
.
.
.
endif
Next i;
How could we write this in qlikview script?
Thanks a lot,
Helen
The problem was the THEN, without it , it works fine:
For i = 1 To $(LOOP_COUNTER)
if i = 1 SET SelectORJoin = 'Sql Select';
else SET SelectORJoin = 'Join (Table1) Select';
.
.
.
.
endif;
Next i;
Thanks a lot!
Hi Helen,
Either with an inline join:
let SelectORJoin = if(i=1, 'SQL SELECT', 'JOIN (Table1) SELECT');
Or with an if structure like VBA:
if i = 1 then
let SelectORJoin = 'SQL SELECT';
else
let SelectORJoin = 'JOIN (Table1) SELECT';
end if
Note that semi colons are not required on the end of the construct lines, the one at the end of your next statement is also superfluous.
Hope that helps,
Steve
The problem was the THEN, without it , it works fine:
For i = 1 To $(LOOP_COUNTER)
if i = 1 SET SelectORJoin = 'Sql Select';
else SET SelectORJoin = 'Join (Table1) Select';
.
.
.
.
endif;
Next i;
Thanks a lot!