Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join us at the Cloud Data and Analytics Tour! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
bibopipo
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
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
sujeetsingh
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;

sujeetsingh
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

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

bibopipo
Creator II
Creator II
Author

Thanks !!

smoon63
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

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

vhtsanden
Contributor II
Contributor II

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

cspindley
Contributor III
Contributor III

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