Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I am new to Qlikview, so what I "know" is from Google...
I have a couple of Excel documents with financial records for different entities. When a file is updated, the user will drop it in a folder (full path will is C:\Test\Current\May_2019_statements.xlsx). When the Qlikview database reloads, the file must be moved to the processed folder (full path will is C:\Test\Processed\May_2019_statements.xlsx).
The Excel files have a summary on Sheet1, clearly indicating the month, and total sales (Columns A1 and B1). My goal is for Qlikview to do the following:
1. Move file from Current folder to Processed folder, if the date modified is newer.
2. Update the records for the specific month in the Qlikview table.
This is what I have so far:
LET ProcessedPath = 'C:\Test\Processed';
LET CurrentPath = 'C:\Test\Current';
FOR each Dir in DirList "$(CurrentPath)"
FOR each File in FileList "$(CurrentPath)\*.xl*"
EXECUTE cmd.exe /C Move /Y "$(CurrentPath)\*.xl*" "$(UnreadPath)\";
next File
next Dir
LOAD * INLINE [
A1, B1
Month Name, Month values
];
From the above, all that works is to move the file, although it replaces without notice and does not do any checks on the last modified dates.
Any help with be much appreciated.
The INLINE load is the issue here, that requires you to give the values, you need to drop the INLINE and load from the Excel files, and I think you are going to need to concatenate things as well, but I am not sure, not a very good developer, sorry.
Here is the link to Help on the Load statement, hopefully this will explain things a bit better, but you can also use the wizard in the desktop client to try to get a better idea of how the script statements should look by loading from one of the Excel files using the Wizard and then look at the code that generates and go from there. Sorry I do not have anything better, but hopefully this may help you get things on track:
Ah, I also wanted to mention a new feature in the 12.30 track, there is a new task type there, File Exists:
Scroll down until you see the File Exists feature there, this might help you out some too, you could use tasks to do things, so when a new file comes in, process it in the load, then kick off another task to move that file from the incoming to the processed folder etc...
Hope this helps a little!
Regards,
Brett