Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

struck with this code regarding incremental update

Hi,

I am struck with this code regarding incremental update.Can anyone please help me.WHERE NOT EXISTS not working.Thank you.

Prodincre:

LOAD ID,

     Product,

     Sales,

     Modified_Date

FROM

incremental_load.xlsx

(ooxml, embedded labels, table is Sheet1)

WHERE(Modified_Date > '$(Last_Updated_Date)'   ); //this is a string var

Concatenate

LOAD ID,

     Product,

     Sales,

     Modified_Date

FROM

Product.qvd

(qvd)

Where Not Exists(ID);

15 Replies
sudeepkm
Specialist III
Specialist III

I would like you to test the below script in a new qvw. Rename your existing qvd to somethingelse.

Also did you have duplicate records in your source xls file when first time you ran the script?

let vLast_Updated_Date = '12/31/1900';

if QvdCreateTime('Product.qvd')>0 then

TMP:

LOAD max(Modified_Date) as mxdt FROM Product.qvd(qvd);

let vLast_Updated_Date = peek('mxdt',0,'TMP');

DROP Table TMP;

end if

Product:

LOAD ID,  Product, Sales, Modified_Date

FROM incremental_load.xlsx (ooxml, embedded labels, table is Sheet1) Where Modified_Date > '$(vLast_Updated_Date)';

if QvdCreateTime('Product.qvd')>0 then

Concatenate

LOAD ID,  Product, Sales, Modified_Date

FROM Product.qvd(qvd) Where not Exists (ID);

end if

inner Join

LOAD ID,  Product, Sales, Modified_Date

FROM incremental_load.xlsx (ooxml, embedded labels, table is Sheet1);

STORE Product into Product.qvd(qvd);

madhumitha
Creator
Creator

HI Lavanya,

I am not very sure, but I think NOT EXIST condition works on Resident tables alone.

Can you try taking a resident load?

Anonymous
Not applicable
Author

Hi Sudeep,

Your code also gave the same result. Not Exists is not  worked here.

thank you

Anonymous
Not applicable
Author

Are you sure both duplicate records aren't just coming from the Excel sheet?


Can you share your excel file and qvw?

Anonymous
Not applicable
Author

incremental.PNG

Hi Willow,

This  is the result of the above code.'Not Exists' not working here.

Thank you

Anonymous
Not applicable
Author

I don't want the result of the script, I want to see what is in your incremental_load.xlsx spreadsheet on Sheet1.