Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
bbmmouha
Creator
Creator

script in first load only

hello

i whant to optimise perfermance of my app for this i whant to load a script in first load only like this

if ( first load ) {

     script 1 } ;

else

     script 2 ;

thank you in advance

1 Solution

Accepted Solutions
bbmmouha
Creator
Creator
Author

i found a solution : in the first load the QVD not exist else if the QVD exist then this is not the first load

LET vListqvdexists=isnull(QvdCreateTime('[lib://qvdfolder\PDV.qvd]'));

if($(vListqvdexists)<> 0) then

script (1) for first load

else

script (2) for the next load

thank you very much Petter and Gysbert

View solution in original post

4 Replies
Gysbert_Wassenaar

Are you looking for the Partial Reload feature?

https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Partial%20Reload.htm


talk is cheap, supply exceeds demand
petter
Partner - Champion III
Partner - Champion III

There is not persistent variable or function that allows you to check for a first load. However if you create a new indicator file / flag file or whatever you want to call it each time you do a load in a special folder- you can check for the existence of that file. If the file doesn't exist then it is the first load.

At the beginning of your script you can have something like this:

FirstLoad=True();

FOR EACH f IN FileList ('LIB://FILES/!NotFirstLoad!.txt');

FirstLoad=False();

NEXT


IF FirstLoad THEN

  INDICATOR_FILE: LOAD * INLINE [Dummy];

  STORE INDICATOR_FILE INTO [LIB://FILES/!NotFirstLoad!.txt] (txt);

  DROP TABLE INDICATOR_FILE;

END IF

bbmmouha
Creator
Creator
Author

thanks petter

the problem is like said Gysbert i have a Partial Reload and i whant to load my data in the qvd and after that i don't load this script(1) and load the script 2 of Partial reload

bbmmouha
Creator
Creator
Author

i found a solution : in the first load the QVD not exist else if the QVD exist then this is not the first load

LET vListqvdexists=isnull(QvdCreateTime('[lib://qvdfolder\PDV.qvd]'));

if($(vListqvdexists)<> 0) then

script (1) for first load

else

script (2) for the next load

thank you very much Petter and Gysbert