You mean, an otherwise empty folder will suddenly contain one or more .csv files and QlikView should immediately load them. Or do you mean that QlikView should load a new file in a directory of existing .csv files as soon as it appears? Only then and never again afterwards?
Both can be handled by QlikView exclusively by creating a document that loads .csv files and by creating a server reload task that runs at regular intervals (say every 5 mins)
You can try something like below,
If FileSize('C:\Users\Tamil\Desktop\Test\*.csv')>0 then
(txt, codepage is 1252, embedded labels, delimiter is '\t', msq);
Load MsgBox ('No files found in the folder!','Status','OKCANCEL','ICONHAND') AutoGenerate 1;
DROP Table Temp;
thanks Tamil..... but what I require is it to loop / keep checking if a file is there & when it is - to old the data.
I just want 1 click to do this, rather than keep hitting reload. A file will eventually be place in the folder as I've kicked off a script to execute another program.... but this program takes a few mins to complete.
Do you have the possibility to trigger a task at the end of the execution of the other program? For example, you've kicked off a script to execute another program - that could mean that you start a CMD file that will wait until the "other program" completes. Add a call to QMSEDX to the end of that CMD file that triggers the reload of your csv-reading-QlikView document. Nobody will waste any time (or cpu cycles) anymore polling a folder for files that may or may not appear. Seems more efficient to me...
On the contrary. Triggering a task only when there is some work to do is always simpeler and way more efficient than creating a program that has to sit and wait until an event (like what you are proposing) occurs. Moreover, the latter solution will consume memory and cpu cycles while doing nothing but wait.
You don't need python to do this, if only windows machines are involved. Assuming that the script you kicked off to start another program can also start a batch file (.CMD) instead, you could enter a statement to start the program in that batch file, followed by a call to QMSEDX to trigger a QlikView server task and reload the csv reader.
I am wary about listing examples as I don't know a thing about your environment and every example that doesn't apply to your situation will only make things look more complex. Can you elaborate on the chain of command from whoever launches the script up until the QlikView document that will actually make use of the csv data? Thanks.
Basically the process is this: (on Windows 7)
1. Opens Explorer -> user selects a file
2. File is moved to a different location
3. Python script is executed (to do some data manipulation & outputs a csv file)
4. Reloads data -> which is the csv file created in step 3....... but the timing for it's completion can vary.
So I'm looking for a way to load the data as soon as the csv file is placed in a folder.
I do not want to close QlikView or manually keep checking if the file is there.