Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Strange and undocumented error with a load

Hello everyone,

I'm having a trouble with a LOAD statement and I can't determine what is causing the problem.

This is the code:

load
ANNO_PROG as maxanno,
max(NORD_PROG) as maxnord,
max(RORD_PROG) as maxrord,
max(SORD_PROG) as maxsord
from $(QVDFILE2) (qvd)
GROUP BY ANNO_PROG
ORDER BY ANNO_PROG;

maxrigTab:




LET INCR_ANNO = 'ANNO_PROG >= ' & peek('maxanno', -1, maxrigTab);
LET INCR_NORD = ' AND NORD_PROG >= ' & peek('maxnord', -1, maxrigTab);
LET INCR_RORD = ' AND RORD_PROG >= ' & peek('maxrord', -1, maxrigTab);
LET INCR_SORD = ' AND SORD_PROG > ' & peek('maxsord', -1, maxrigTab);
SET INCR_STR = $(INCR_ANNO)&$(INCR_NORD)&$(INCR_RORD)&$(INCR_SORD);

DROP table maxrigTab;

Basically the first field is a date and i need to get the max of the other fields divided by date, then I need to store the data for the LAST year into some variables to build a string for an incremental load.

When I try and reload the data (the QVD file is there and there is the right data in it, i double checked it) qlik goes into error that can roughly translate into "Delete after instruction" or "Cancel after instruction" pointing to the maxrigTab table code.

What am I doing wrong?

Thanks in advance for any help.
--
mfurno



What am I doing wrong?

Thanks in advance for any help.
--
mfurno





1 Solution

Accepted Solutions
vidyut
Partner - Creator II
Partner - Creator II

Seems that the Group By stmt followed by Order By stmt causes the problem.

So if you remove the Order by stmt from the first load, and Do the ordering in the second load, that should help in avoiding this error.

View solution in original post

2 Replies
vidyut
Partner - Creator II
Partner - Creator II

Seems that the Group By stmt followed by Order By stmt causes the problem.

So if you remove the Order by stmt from the first load, and Do the ordering in the second load, that should help in avoiding this error.

Not applicable
Author

That worked like a charm, thanks.
--
mfurno.