Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Check file exist via macro

Hi all,

I am new in Qlikview and facing a problem in check file exist.

I have create a macro to check if file exist. and don't know how to call it out in script.

I want to do

if the xxx.qvd exist then do some incremental loading, if not exist will load all of record from an xls.

Here is my macro function:

Function CheckFileExist(filename)

    Set objFSO = CreateObject("Scripting.FileSystemObject")

    Dim result

   

    If objFSO.FileExists(filename) Then

        result = 1

        msgbox ("good")

    Else

        result = 0

        msgbox ("not good la ...")

   

    End If

    CheckFileExist = result

End Function

Please help ...

or if any other way to do so ?

Thanks~

1 Solution

Accepted Solutions
fosuzuki
Partner
Partner

Hi, in the Script, you can use the filetime() function to check if a file exists.

For example:

if isnull(filetime('c:\file.txt')) then

//file doesnt exists

else

//file exists

end if

Hope this helps you.

Regards,

Fernando

View solution in original post

2 Replies
fosuzuki
Partner
Partner

Hi, in the Script, you can use the filetime() function to check if a file exists.

For example:

if isnull(filetime('c:\file.txt')) then

//file doesnt exists

else

//file exists

end if

Hope this helps you.

Regards,

Fernando

View solution in original post

Not applicable
Author

Hey Fernando,

Thanks for you help...filetime() works ..