Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
Please help me in the incremental data load.
I have declared the variable which pulls the max. date, then used this variable in main script.
The issue I am facing is that when I first upload the data it loads the new data correctly
When I reload the data it shows that no data is loaded i.e. 0 lines fetched but it removes the old data.
When I reload the data again it pulls all the data from the starting
I want that it pulls the new data only. When I reload the data it pulls zero lines with old data in it and this process repeats again and again
LOAD SCRIPT:
LIB CONNECT TO 'TIGUNVMBGWL0011';
LOAD CustomerName,
ContactName,
POSTDATE;
SQL SELECT CustomerName,
ContactName,
POSTDATE
FROM msdb.dbo.Customers
Where POSTDATE >'$(Last_Update_Date)';
VARIABLE:
Last_Update:
LOAD Max(POSTDATE) as maxdate
resident Customers;
Let Last_Update_Date = Date(peek('maxdate',0,'Last_Update'),'YYYY-MM-DD');
Please find the snapshot of the load
Please help an guide me where I correct myself
Thanks a lot sir!!
Just a small query, if the QVD does not exist and I want that pass the variable which dynamically pull the data from the first day.. if yes then how??
Thanks again!!
take this line of the script out into an include file so you can modify it externally
Let Last_Update_Date = '2000/01/01'; //Use whatever date you want here to pull all your data from database