Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Reload failed for delta loAD

Hi All,

I am facing reload failed error for delta-inserts.

How to resolve?

EMP:

SQL SELECT EMPNO,

     ENAME,

     JOB,

     MGR,

     HIREDATE,

     SAL,

     COMM,

     DEPTNO,

     ModificationTime

FROM

(ooxml, embedded labels, table is EMP)

WHERE ModificationTime >= #$(LastExecTime)#

AND ModificationTime < #$(BeginningThisExecTime)#;

Concatenate

LOAD EMPNO,

     ENAME,

     JOB,

     MGR,

     HIREDATE,

     SAL,

     COMM,

     DEPTNO

FROM

C:\Users\QV\EMP.qvd

(qvd);

store EMP into C:\Users\QV\EMP.qvd;

EMPNOENAMEJOBMGRHIREDATESALCOMMDEPTNOModificationTime
7369SMITHCLERK790217-Dec-808002023-Jan-82
7499ALLENSALESMAN769820-Feb-8116003003023-Jan-82
7521WARDSALESMAN769822-Feb-8112505003023-Jan-82
7566JONESMANAGER78392-Apr-8129752023-Jan-82
7654MARTINSALESMAN769828-Sep-81125014003023-Jan-82
7698BLAKEMANAGER78391-May-8128503023-Jan-82
7782CLARKMANAGER78399-Jun-8124501023-Jan-82
7788SCOTTANALYST75669-Dec-8230002023-Jan-82
7839KINGPRESIDENT17-Nov-8150001023-Jan-82
7844TURNERSALESMAN76988-Sep-81150003023-Jan-82
7876ADAMSCLERK778812-Jan-8311002023-Jan-82
7900JAMESCLERK76983-Dec-819503023-Jan-82
7902FORDANALYST75663-Dec-8130002023-Jan-82
7934MILLERCLERK778223-Jan-8213001023-Jan-82

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

Check this working script

LET BeginningThisExecTime = Now();

LET LastExecTime = Alt(LastExecTime, 0);

Temp:

LOAD EMPNO,

     ENAME,

     JOB,

     MGR,

     HIREDATE,

     SAL,

     COMM,

     DEPTNO,

     ModificationTime

FROM

test.xlsx

(ooxml, embedded labels, table is Sheet1)

WHERE ModificationTime >= '$(LastExecTime)'

AND ModificationTime < '$(BeginningThisExecTime)';

LET LastExecTime = BeginningThisExecTime;

IF FileSize('C:\Test.qvd') > 0 then

Concatenate (Temp) 

LOAD EMPNO,

     ENAME,

     JOB,

     MGR,

     HIREDATE,

     SAL,

     COMM,

     DEPTNO

FROM

C:\Test.qvd

(qvd);

EndIF;

store Temp into C:\Test.qvd;

Regards,

Jagan.

View solution in original post

4 Replies
Colin-Albert

Does the qvd file exist?

Your post shows the variables as. #$(variablename)# this should be '$(variablename)'

Do the formats of the variables match the fields they are being compared to?

jagan
Luminary Alumni
Luminary Alumni

  1. LET BeginningThisExecTime = Now();
  2. LET LastExecTime = Alt(LastExecTime, 0);

  3. EMP: 
  4. SQL SELECT EMPNO, 
  5.      ENAME, 
  6.      JOB, 
  7.      MGR, 
  8.      HIREDATE, 
  9.      SAL, 
  10.      COMM, 
  11.      DEPTNO, 
  12.      ModificationTime 
  13. FROM 
  14.  
  15. (ooxml, embedded labels, table is EMP) 
  16. WHERE ModificationTime >= #$(LastExecTime)# 
  17. AND ModificationTime < #$(BeginningThisExecTime)#; 

  18. LET LastExecTime = BeginningThisExecTime;

  19. Concatenate   
  20. LOAD EMPNO, 
  21.      ENAME, 
  22.      JOB, 
  23.      MGR, 
  24.      HIREDATE, 
  25.      SAL, 
  26.      COMM, 
  27.      DEPTNO 
  28. FROM 
  29. C:\Users\QV\EMP.qvd 
  30. (qvd); 

  31. store EMP into C:\Users\QV\EMP.qvd; 


Hope this helps you.


Regards,

Jagan.

jagan
Luminary Alumni
Luminary Alumni

Hi,

Check this working script

LET BeginningThisExecTime = Now();

LET LastExecTime = Alt(LastExecTime, 0);

Temp:

LOAD EMPNO,

     ENAME,

     JOB,

     MGR,

     HIREDATE,

     SAL,

     COMM,

     DEPTNO,

     ModificationTime

FROM

test.xlsx

(ooxml, embedded labels, table is Sheet1)

WHERE ModificationTime >= '$(LastExecTime)'

AND ModificationTime < '$(BeginningThisExecTime)';

LET LastExecTime = BeginningThisExecTime;

IF FileSize('C:\Test.qvd') > 0 then

Concatenate (Temp) 

LOAD EMPNO,

     ENAME,

     JOB,

     MGR,

     HIREDATE,

     SAL,

     COMM,

     DEPTNO

FROM

C:\Test.qvd

(qvd);

EndIF;

store Temp into C:\Test.qvd;

Regards,

Jagan.

Not applicable
Author

Thank you Jagan.