Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Looking for a way to reload script only when necessary

Hi,

I am looking for a way to control the reloading of a document, so only when a certain data is available the reloading will take place.

Alliteratively, the reloading can occur every hour, but in the script it should be checked whether certain criteria is met, and if so the loading should go on, and if not the loading should stop and return to its pre-reloading state.

Thanks,

Guy

1 Solution

Accepted Solutions
erichshiino
Partner - Master
Partner - Master

For you alternative, you can use a 2-tier data architecture.

1 ) Extrator: A qvw will check the condition. If it is met, it proceeds with reload and generate some qvds. If not, you can skip the reload using 'Exit script ( the qvds will not be updated)

2) Application: It will read qvds generated by the extractor and update the interface

Hope this helps,

Erich

View solution in original post

10 Replies
erichshiino
Partner - Master
Partner - Master

For you alternative, you can use a 2-tier data architecture.

1 ) Extrator: A qvw will check the condition. If it is met, it proceeds with reload and generate some qvds. If not, you can skip the reload using 'Exit script ( the qvds will not be updated)

2) Application: It will read qvds generated by the extractor and update the interface

Hope this helps,

Erich

Not applicable
Author

Hi Erich,

If i understand you right, I should have 2 QVWs that each of them run every our? if so, I think it doesn't save much time, because reading the QVD in the application each hour takes lot of time and resources from the server.

Maybe may i use the condition in my oroginal QVW, and if the condition isn't met, just quit the reloading without any impact on the document?

Thanks,

Guy

Miguel_Angel_Baeyens

Hi Guy,

You can wrap all your script tabs in a conditional.

IF condition THEN

Table1

LOAD *

FROM ...

[...] // script here

END IF

Hope that helps.

Miguel

Not applicable
Author

Hi Guy,

I don't think you can just Quit the reloading without any impact on the document. Because on QV server or manual reload will update your Qlikview application once the reload happen.

The two tire architechure explained by Erich will work in your scenario. There are many reason why should we go with two tire architechure.  One of among them is the one which you want -  Conditional reload.

Hope this help,

Anosh Nathaniel

Not applicable
Author

Indeed, using two tire architecture will decrease the time and effort regarding the creation of the QVDs.

One thing left (though i think now it is not so significant) that still the Application tier will have to load other data in addition to the prepared QWD (because it still runs every hour).

Anyway, i am going to implememt this solution.

Thanks a lot pales!

Guy

Miguel_Angel_Baeyens

Hi Guy,

Note that you can do a binary load from another existing QVW, that will load only Tables and Fields (not variables nor charts or scripts or any other items). But you can add new tables to a binary load.

Hope that helps.

Miguel

Not applicable
Author

Hi,

Yes, it is another possibility. Is there any advantage of using a Binary Load comparing to loading only the QVD ?

Anyway, both cases require dependency between the first document (that prepare the QVD) and the second document (that read the prepared QVD).

So, it is better that loading the second document will occur immediately after the execution of the first document, and this can be achieved by using the reloading option -  "On Event from Another Task" - in the Reload Tab in the Managemnt Console.

Thanks,

Guy

Miguel_Angel_Baeyens

Hi,

It depends on how many files do you have and how many tiers do you use in your architecture. Say that you have a QVW file that loads from database all data regarding Customers storing into QVD. Then you have a second QVW that consolidates the Customer dimension, and likewise with Company, Country, Invoices... You have several QVWs each corresponding to an "entity". You can binary load one of those, then drop existing tables or add new tables...

But of course if you want to reload just after the previous successful load, use the trigger you mention.

Hope that helps.

Miguel

Not applicable
Author

If i understand you right, QVD represent one table, while binary load may represent more complex stracture.

Thanks a lot!

Guy