Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
Is there a way to to do a "GOTO" command in QlikView script? Currently I have a situation where I need to do some data checking before executing the load script. The sample scenerio:-
ExecDate=select top Date from ControlTable;
if not exists( select * from Data where Date=$(ExecDate)) then
goto Error;
else
LOAD * from Data2;
end if;
<Other load statement here... will be skipped if there is an error in the data checking above)>
Error:
LET errormsg='No data for this date';
Hi
I think, we don't have facility to transfer the control from one place to other place to execute the commands.
My suggesting is, you can try as below:
ExecDate=select top Date from ControlTable;
if exists( select * from Data where Date=$(ExecDate)) then
LOAD * from Data2;
<Other load statement here... will be skipped if there is an error in the data checking above)>
Else
LET errormsg='No data for this date';
end if;
HI
You can try it through Macro statement.
Regards
Sunil kumar Panda
Hi Sunil,
Thanks for the suggestion. But do you have any other method? This is because macro might not work with Publisher.
Hi
I think, we don't have facility to transfer the control from one place to other place to execute the commands.
My suggesting is, you can try as below:
ExecDate=select top Date from ControlTable;
if exists( select * from Data where Date=$(ExecDate)) then
LOAD * from Data2;
<Other load statement here... will be skipped if there is an error in the data checking above)>
Else
LET errormsg='No data for this date';
end if;
Thanks for the suggestion. I guess there is no other method other than using the else statement.