Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I would liek to refresh my QlikView application based on the presence of a txt file.
If the file exists, I can load my application with the code:
let path_prices = 'ok.txt';
for each File in filelist (path_prices)
myTab:
LOAD* from TABLE
NEXT;
However, if the file doesn't exist, my app is blank.
I would like to make a loop for a time on the directory to start loading the application once the txt file is created.
Do you have an idea please?
Thanks you
Hi Stephane,
I would go at it this way:
LET vExist = ifnull( filetime('uvw.txt));
IF $(vExist) = 0 //file exist
ELSE //it doesn't exist
Massimo, it is a txt file, not a QVD.
A
I know; in that post there are answers for qvd and txt (and links to other answers too). My answer above all was to kindly suggest that there is (upper right) a useful search function.............and a lot of answers are already here in the community
You can use FileSize() function also for checking the existence of the TXT file.
Try this script. The first lines of the script should be the below part
if isnull(filesize('C:\Users\ABDC\Desktop\test.txt')) then
exit Script;
ENDIF
'The Rest of the script comes here.
You can try this load script for checking the file is present or not
Let vFileSize = FileSize('D:\YourFileLocationHere\Ok.txt');
If $(vFileSize) = 0 then
LOAD *,'QVD file' as FileType
FROM
TableName.qvd
(qvd);
//EXIT Script;
ELSEIF $(vFileSize) > 0 then
TableName:
LOAD *,'TXT file' as FileType
FROM
[YourFileLocationHere\Ok.txt]
(txt, codepage is 1252, embedded labels, delimiter is '\t', msq);
STORE TableName into TableName.qvd;
ENDIF
Note:- Change the file location as your file location.
My bad Massimo