Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
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 - Specialist III
Partner - Specialist III

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 - Specialist III
Partner - Specialist III

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

Not applicable
Author

Hey Fernando,

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