Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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);
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);
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?
Hi Sudeep,
Your code also gave the same result. Not Exists is not worked here.
thank you
Are you sure both duplicate records aren't just coming from the Excel sheet?
Can you share your excel file and qvw?
Hi Willow,
This is the result of the above code.'Not Exists' not working here.
Thank you
I don't want the result of the script, I want to see what is in your incremental_load.xlsx spreadsheet on Sheet1.