Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator II
Creator II

How can I check if a file exists ?

Dear all,

is it possible to verify if a file exists or not ?

Thanks in advance

1 Solution

Accepted Solutions
Highlighted
Not applicable

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

View solution in original post

8 Replies
Highlighted
Master III
Master III

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;

Highlighted
Master III
Master III

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

Highlighted
Not applicable

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

View solution in original post

Highlighted
Creator II
Creator II

Thanks !!

Highlighted
Partner
Partner

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

Highlighted
Not applicable

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

Highlighted
Contributor II
Contributor II

i ilke the way you formulated your answer. clear, usefull and concrete

Highlighted
Contributor III
Contributor III

thank you for your help with this, i am up and running again ...