Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

bibopipo
Contributor 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

Re: How can I check if a file exists ?

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

8 Replies
sujeetsingh
Honored Contributor III

Re: How can I check if a file exists ?

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
Honored Contributor III

Re: How can I check if a file exists ?

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

Re: How can I check if a file exists ?

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

bibopipo
Contributor II

Re: How can I check if a file exists ?

Thanks !!

Highlighted
smoon63
Contributor

Re: How can I check if a file exists ?

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

Re: How can I check if a file exists ?

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
New Contributor II

Re: How can I check if a file exists ?

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

cspindley
New Contributor II

Re: How can I check if a file exists ?

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

Community Browser