Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Close QlikView from Script

Hello,

how can i close QlikView from Load script?

I try this.

Macro Module


function quit2()
Application.Quit
and
ActiveDocument.GetApplication.Quit
end function


Load Script


let cl = quit2();


that does not work


Thanks!!!

1 Solution

Accepted Solutions
gandalfgray
Specialist II
Specialist II

Add an OnPostReload trigger calling your quit2 macro:

View solution in original post

7 Replies
Not applicable
Author

Try this,

function quit2()
ActiveDocument.GetApplication.Quit
end function

siva_boggarapu
Creator II
Creator II

Hi,

try Exit Script . I think it may work

gandalfgray
Specialist II
Specialist II


Siva wrote:
Hi,
try Exit Script . I think it may work<div></div>


exit script in the load script just exits the load script. It does not quit the application.

gandalfgray
Specialist II
Specialist II

Add an OnPostReload trigger calling your quit2 macro:

Not applicable
Author

I maybe after the same thing here and it is not looking possible.  But what I need is within the script (Not Macro) to reload on a Monday, Tuesday and not Wednesday onwards.

So seuodo =

IF Date(Today(),'WWW') = 'Mon' then

Load blah blah blah

ElseIF <> Mon or Tue for that matter

Close Qlikview but keep data as it was prior to this session.

( I see Exit Script, but that removes the old data and I end up with a blank doc)

Is there a suggestion not using Publisher or a batch file (Which is what I have had to do using windows Scheduler - which is rubbish)??

Help appreciated

Peter

flipside
Partner - Specialist II
Partner - Specialist II

Hi Peter,

I use a "Control" .qvw document to manage my multiple and infrequent reloads. You can set the control document to reload every day at the desired time and check the day in an 'if' statement. If the script is true, then force the control document to FAIL by using something like this ...

If (day(today()) = 'Mon') then

     Load nonexistant field from nonexistant table;

EndIf;

When the if statement is false, the control document succeeds, but when it is true it fails. You then set up your target document to run on the failure state of the control document. It won't refresh when the control document succeeds. Your admin just need to know that the Control doc will sometimes show a failure state by design.

Hope this helps.

flipside

Not applicable
Author

This will work perfectly for me.

Thank you!!