Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to identify when in batch mode?

Hi all,

I have a macro associated with the 'OnOpen' document event but I don't want to run the code when in batch mode (that is running using the '/R' switch).

How can I detect it so that I can warap an 'if' statement around the code in the macro?

Thanks!

Gordon

4 Replies
martin59
Specialist II
Specialist II

Hi,

You can modify a variable value with the batch script line.

I think it's like this :

Qv.exe /vVariableName=1 /r QvApp.qvw


Not applicable
Author

Hi Martin,

Thanks for your reply - that will certainly work. I wondered if it were possible to detect the use of the /r switch directly instead though.

Regards,

Gordon

Not applicable
Author

Actually, the problem with passing a variable with /v as well as using the /r switch is that the variable gets set to the passed value and the document saved with it, so you have to reset the value too.

Regards,

Gordon

Not applicable
Author

Adding to Gordon's point:

Add as the last line in your loadscript a Set statement that changes your batch variable to zero (or whatever you're using for a non-batch value).