Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I receive Excel files every month (the file name is always the same) and need to add it to my qvd. My script moves the file to another folder after being uploaded.
The issue is that each time the script runs, the entire document is uploaded, resulting in duplicate values being added together and my app's data is skewed by this.
I basically want the load script to check if the row entry exists and if it does, skip to the next row (and check again).
This is the current load script I have:
Let FileDateValue = Peek('Date', 0, 'NEW DATA');
[OLD DATA]:
NoConcatenate
LOAD
*
FROM [$(QvdPath)]
(qvd)
Where Date <> '$(FileDateValue)';
Concatenate ([OLD DATA])
LOAD
*
Resident [NEW DATA];
Drop Table [NEW DATA];
Store [OLD DATA] Into '$(QvdPath)';
Drop Table [OLD DATA];
Just a side note, my table has the following columns:
- Code
- Description
- Office
- Transaction type
- Sum(Value)
Any help will be highly appreciated.
Hi Ben
You can put in a where Not exists (<Key field>,<Key field2>) clause in the load for the new data, so long as you have a suitable key field or combination of fields.
Ron