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: 
kdaniels-obrien
Partner - Creator
Partner - Creator

Loading different data sets at different times

Hi, 

I have a REST connection that is bringing in data from a web service every 5 minutes using the scheduler in the QMC.  I also have 6 files that call on SQL Server for data that usually stays the same but could change.  I would like to set up my app so that Qlik only loads those files weekly.  Is it possible to have the app on a schedule to load every 5 minutes but only load the other files weekly?

2 Replies
dplr-rn
Partner - Master III
Partner - Master III

You can put the calls you want to do weekly within a if condition. and load  it only on a certain day of the week and before certain time

e.g. Load  it only on Mondays and approxiate time of first run on monday is before 1 am

If WeekDay(today())=1 and hour(now()) <1 then

   //your load statements

end if

dplr-rn
Partner - Master III
Partner - Master III

or you could instead of time you could use a temp table which you set a flag save it as qvd and manipulate so that it will run only on first run of monday 

e.g.

 

LoadPerformedTempTable:
LOAD * from [lib://FolderConnection/LoadPerformed.qvd] ;
let vLoadPerformed = 
              Peek('LoadPerformed',0,'LoadPerformedTempTable');
drop table LoadPerformedTempTable;

If WeekDay(today())=1 and vLoadPerformed=0  then

   /**
       Add your weekly load statements
   **/
  // Mark load as performed so that load is performed only once on monday
	LoadPerformedTempTable:
	load * inline [
	LoadPerformed
	1
	];
	
	Store * from LoadPerformed into 
                 'lib://FolderConnection/LoadPerformed.qvd';
	drop table LoadPerformedTempTable;

elseif WeekDay(today())=2 then 
      //On tuesday mark it back to zero so that first run next monday 
       //everything will load 
      LoadPerformedTempTable:
	load * inline [
	LoadPerformed
	0
	];
	
	Store * from LoadPerformed into 
                 'lib://FolderConnection/LoadPerformed.qvd';
	drop table LoadPerformedTempTable;
end if