Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
dcp1
Contributor
Contributor

Conditonal Reload

Hi,

I have a database which can be updated at any point, however I don't want to place a constant load on the server by completely reloading the tables into Qlik Sense all the time, so I'm looking for a way to check if the database has been updated, and if so reload all the tables. However - if the database hasn't changed, the load script should just keep the data that was loaded previously. I've found a way to check for a change in the data, and to load everything if a change has taken place...

 

BUT

 

If no change has taken place, and my script exits - my model is empty. Obviously I've missed something - what should I try to ensure that my model isn't empty. The code I'm using goes something like this:

{Set initial standard variables}
LIB CONNECT TO [database]
[Temp_table]:
SQL {single value to indicate change};
Let vChange = FieldValue('sql_changed', 1);
IF vChange = 1 THEN
  SQL UPDATE {reset data to indicate nothing has changed};
ELSE
  Exit Script; <-- This is obviously wrong
ENDIF
{code continues for full load}

 

Any help here would be appreciated.

1 Solution

Accepted Solutions
dplr-rn
Partner - Master III
Partner - Master III

Onreload the qvw purges all pas memory. for above to work you need to save the data as a qvd and reload that if no change has occured.
e.g.
IF vChange = 1 THEN
SQL UPDATE {reset data to indicate nothing has changed};
ELSE
//load all the necessary tables from qvd
LOAD * FROM xyz.qvd (qvd);
exit script;
endif
//rest of your code
//at the end store all the necessary tables in qvd
Store mytable into xyz.qvd (qvd);

also checkout incremental load. might help you finetune your load
https://www.analyticsvidhya.com/blog/2014/09/qlikview-incremental-load/

View solution in original post

1 Reply
dplr-rn
Partner - Master III
Partner - Master III

Onreload the qvw purges all pas memory. for above to work you need to save the data as a qvd and reload that if no change has occured.
e.g.
IF vChange = 1 THEN
SQL UPDATE {reset data to indicate nothing has changed};
ELSE
//load all the necessary tables from qvd
LOAD * FROM xyz.qvd (qvd);
exit script;
endif
//rest of your code
//at the end store all the necessary tables in qvd
Store mytable into xyz.qvd (qvd);

also checkout incremental load. might help you finetune your load
https://www.analyticsvidhya.com/blog/2014/09/qlikview-incremental-load/