Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Delta Reload: Only Republish New Data

Hi all,

I have two tasks, where the second task is dependant on the first (currently by a "successful reload of...."). I am looking for a good way to only have the second task execute when the first task's sql query finds new delta data. This is done by running a simple SQL query and comparing a date/time field with a QVD stored date/time from the last load. Only when they differ should the first task continue building all the other QVD files, and then the second job will also run to republish the QVW file. Otherwise, the first job should immediately quit, the second job should not run, and it will try again in another 30 minutes.

Any idea of a good structure to do this? Currently I thow in a bad statement (loading from a table that does not exist) in the Else condition that causes the first job to immediately fail.

Server version: QV 10 SR 3 (10.00.9070.7)

UPDATE**********

My Script is currently set up like this:

LASTLOADED:

sql select G.LAST_COMPLTD_FISCAL_DT

FROM CURRENT_DATES_V;

LASTLOADED2:

LOAD LAST_COMPLTD_FISCAL_DT AS OLD_DATE

FROM

..\QVD\LASTLOADED.qvd

(qvd);

let load_check = peek('LAST_COMPLTD_FISCAL_DT',0,'LASTLOADED');

let load_check_old = peek('OLD_DATE',0,'LASTLOADED2');

if load_check > load_check_old then

//Do all remaining SQL Queries

ELSE

trace( 'No New Data');

load [ThisThrowsAnError] FROM ../DATA/NotExistingTable.txt(txt);

end if

2 Replies
jagannalla
Partner - Specialist III
Partner - Specialist III

Hi,

If I understood your problem, you can do this by if condition.

Delta:

Load * from Delta;

If NoOfRows('Delta') >0 then

SecondTable:

Load * from SecondTable;

End If

Hope it helps you.

Cheers!!

Jagan

Not applicable
Author

My Script is currently set up like this:

LASTLOADED:

sql select G.LAST_COMPLTD_FISCAL_DT

FROM CURRENT_DATES_V;

LASTLOADED2:

LOAD LAST_COMPLTD_FISCAL_DT AS OLD_DATE

FROM

..\QVD\LASTLOADED.qvd

(qvd);

let load_check = peek('LAST_COMPLTD_FISCAL_DT',0,'LASTLOADED');

let load_check_old = peek('OLD_DATE',0,'LASTLOADED2');

if load_check > load_check_old then

//Do all remaining SQL Queries

ELSE

trace( 'No New Data');

load [ThisThrowsAnError] FROM ../DATA/NotExistingTable.txt(txt);

end if