Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

GoTo command in script

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';

1 Solution

Accepted Solutions
Not applicable
Author

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;

View solution in original post

4 Replies
sunil2288
Creator III
Creator III

HI

You can try it through Macro statement.

Regards

Sunil kumar Panda

Not applicable
Author

Hi Sunil,

Thanks for the suggestion. But do you have any other method? This is because macro might not work with Publisher.

Not applicable
Author

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;

Not applicable
Author

Thanks for the suggestion. I guess there is no other method other than using the else statement.