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

Qlikview Personal edition reload with Windows task scheduler

Hi Guy,

I am on PE at the moment, My requirement while evaluating Qlik for our company is below, Please can anybody help me on this

I have a very small amount of data from csv file, Now I have created couple of charts and want this to be automatically reload and update the records. The idea is to open the desktop edition on a screen in the office and schedule the reload every 15 mins so that the records gets updated, I have successfully made it to reload with -r command but this is not updating the records while the document is open, I also tried command L which always opens a new instance of desktop and updates the record but doesn't save the qvw which is fine, but am struggling to find a way to not open new instance but to show in the current open qvw (desktop itself), Is there a way to do this please...

Thanks for your help

1 Solution

Accepted Solutions
swuehl
MVP
MVP

1) Create a test script that changes value (to show the successful reload):

LOAD Ceil(RAND()*10) as Test

autogenerate 1;

2) Reload

3) Create listbox for field Test

4) Create a Macro

2018-01-17 18_55_27-Edit Module.png

5) Create a Variable vVar

=Round(Now() , maketime(0,0,15))

(for a 15 second reload)

=Round(Now() , maketime(0,15,0))


for a 15 minute reload

6) Create a variable onChange trigger in Settings-Document properties - Triggers:

2018-01-17 19_05_08-Reply to Re_ Qlikview Personal edition reload ... _ Qlik Community.png

View solution in original post

36 Replies
Anonymous
Not applicable
Author

I am trying to do this which gives me desired result but.....since my schedule is for 15 mins it always opens a new instance rather than updating the already opened desktop , Any help to update in the exsiting opened document pleasee?? even with macros or whatsoever please. this is kind of urgent

L

This switch will open the report, load the script, and leave the report open for further processing and/or analysis.  This is a convenient way to setup a Desktop shortcut for a specific report to reload when opened.  Ex: “C:\Program Files\QlikView\QV.exe” /L “C:\My QV Data\Report1.qvw”

marcus_sommer

I'm not sure if you could solve this task with command-line batches but with vbs-batches it could be possible. Here an example what is meant: Re: Vbs - passing parameters to opendoc or opendocex.

- Marcus

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Take a look at using a keyboard simulator like AutoIt - AutoIt‌. You could have it run a Ctrl-r in the existing window every 15 minutes.

-Rob

Anonymous
Not applicable
Author

Hi Rob, Thanks for your reply, I have gone through the above link Autolt but didn't get my head around it how to implement this in my scenario, Can you please explain me if possible Thanks again

Anonymous
Not applicable
Author

Hi Marcus, Thanks for your reply, I have looked at your link, I am very much newbie to VBA scripting, I am trying to put your code from the above link in Qvw-->Edit Module-->VBScript

Option Explicit

Dim QA, QD, apppath, newdoc 

apppath = "C:\Users\sandeep.movva\Desktop\cwdl_iot_dev\cwdl_iot_dev.qvw"

set QA = CreateObject("QlikTech.QlikView")

set QD = QA.ActiveDocument.GetApplication

set newdoc = QD.OpenDoc(apppath, "","")

newdoc.ReloadEx 0,1

newdoc.save

newdoc.CloseDoc

QD.Quit 

Getting below error

"ActiveX component can't create object: 'QlikTech.QlikView'"

I have taken out param1 = inputBox("param: ") and param1 as I don't need to pass on any parameters, Can you please help me step by process to achieve this

marcus_sommer

You need to enable system access for this modul - it's about in the mid of the left pane of the modul-editor.

- Marcus

Anonymous
Not applicable
Author

Hi Marcus,

I have enabled the system access,QV desktop hangs and closes after I click either Check at the top or click on OK, If I get this to work what will be the next step please? Do I need to schedule the windows task schedule and it will update the records in the same instance?

Thanks again

marcus_sommer

It's difficult to say what might be wrong. I think it's creating a new QlikView instance where I'm not sure if it could work within QlikView itself. The example from above was meant to be in an external vbs-batch. However the probably best way to start with troubleshooting will be to reduce the code by uncommenting most parts and then enabling step by step the next parts until it runs.

Beside this I think I would use a bit different approach because if I understand your description right there is no user-action only displaying the dashboards by updating the data on regular basis. This would be:

Option Explicit

sub UpdateReport

Dim QD, doc

set QD = QA.ActiveDocument.GetApplication

set doc = ActiveDocument

for i = 1 to 1 * 4 * 12 'running 12 hours each 15 minutes

     doc.ReloadEx 0,1

     doc.save

     QD.Sleep 1000 * 60 * 15 'sleep for 15 minutes

next

doc.CloseDoc

QD.Quit 

end sub

This routine would be started from an OnOpen-trigger in the application and the application would be executed from the windows-task.

- Marcus

swuehl
MVP
MVP

If you can't make Rob's solution work, try creating a timer in your qvw and call a simple macro to reload.

Attached a sample (reused a qvw from another post, Info screen with triggered selection).

Basically, create a variable that changes based on rounded now().

(Yes, using now() will add some load on your system and is not recommended in general, if you just need a kind of permanent display, this might not be an issue in your case)

Create a onChange trigger in document settings for that variable, with an macro call action.

Macro looks like

Sub Test

    ActiveDocument.Reload

End sub´