Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear all,
is it possible to verify if a file exists or not ?
Thanks in advance
LET vListqvdexists=isnull(QvdCreateTime('File.qvd')); // if qvd exists then 0 else -1
//if Qvd is exist then Delta loading Else Initial Loading.
Regards-Bika
Consider this script it may help you
SET vFileName='C:\Users\Sheet.txt';
Let vFileExsist=if(FileSize($(vFileName))>0,-1,0);
if $(vFileExsist) then
Table1:
load * from $(vFileName)
(ooxml,no labels,table is[]);
Else
Load
MsgBox('File Not Found') as Warning1;
End if;
you can go to following thread they will help you.
http://community.qlik.com/thread/28381
http://community.qlik.com/message/340253#340253
Hope it will help you
LET vListqvdexists=isnull(QvdCreateTime('File.qvd')); // if qvd exists then 0 else -1
//if Qvd is exist then Delta loading Else Initial Loading.
Regards-Bika
Thanks !!
To make the variable act as a Boolean value, add "not" before isnull:
LET vListQVDExists = not isnull(QVDCreateTime('File.qvd'));
Now you can use
IF $(vListQVDExists) THEN...
instead of
IF $(vListQVDExists) = 0 THEN...
Hope that makes it easier,
Scott
Hi ,
Is it possible to check and not to load a sheet in excel file which is not existing ?
I have a situation in which in one excel file have couple of sheets. First and second sheets are on monthly bases, but third is on quarterly base. I would like to load first two and check if third is existing . If not skip and load other sheets, if exist load all.
I attach a sample excel file.
Thanks in advance
i ilke the way you formulated your answer. clear, usefull and concrete
thank you for your help with this, i am up and running again ...
You can check it with FileList():
LET vFileName='/A/B/C.D';
LET vFileExist=0;
FOR Each vFile in FileList('$(vFileName)')
LET vFileExist=1;
Next vFile;
IF (vFileExist = 1) THEN
TRACE File exists;
ELSE
TRACE File does not exist;
END IF