We have an intermittent problem with an incrementing load which seems to fail sometimes but only on some monday mornings ... we have diagnosed the issue is down to the Script which creates a new incremental qvd every monday by doing :
Newfile: Load * where Id > LastLoadedID ... Store into .... QVD.
On next interval it does a FinD max LastLoadedID in Newfile.QVD as you would expect.
The Problem Occurs when it finds no records on the first run of a monday morning. it Stores the QVD with no rows but the filesize is greater than 0 this casues All subsequent loads to fail as the LastLoadedId for the Next run is Null.
the Fix appears to be not to store thefFile if there are no rows, but How do I create the logic to store the qvd only if tableRows exist ?
I think that "then" must be in the same line that the "if" statement... Like below:
Load * where Id > LastLoadedID;
IF NoOfRows('Newfile') > 0 THEN
Store Newfile into .... QVD;
TRACE No new records found!;
From the QlikView help:
Since the if..then statement is a control statement and as such is ended with either a semicolon or end-of-line, each of its four possible clauses (if..then, elseif..then, else and end if) must not cross a line boundary.