Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Vegar
MVP
MVP

Filesize() returns values when NULL is expected

I have one application containing a script that checks the filesize of an qvs file.

Filesize('/initlink.qvs')

There is no initlink.qvs file in the application folder and I expect the result to be null() (or zero). I do have a initlink.qvs file in another folder ..\..\initlink.qvs, but that should not affect my output.

When opening and running it using a shared network adress \\servername\folder\subfolder\application\ then the function returns null()

When opening an running the script using the local drive adress E:\Qlikview\folder\subfolder\application\ then I get the value 5048. 

Screenshot_20230921_004340_Gallery.jpg

I am using the exact same instance of QlikView Desktop installed on a QlikView Server in both my script executions.

I believe this expression returned null() running from both locations earlier this week, but something has changed and I dont understand why.

Have you seen this behaviour before? What can be the reason for this behaviour?  How can I solve this without making  any changes to the script.

- Vegar 

Labels (2)
1 Solution

Accepted Solutions
Vegar
MVP
MVP
Author

Issue solved. I'll explain for future reference.

I've missunderstood how Qlik interpreted the path that I used. 

Filesize('/InitLink.qvs') will point to the root of the drive that I am on. So when calling this function from the application E:\Qlikview\folder\subfolder\application\MyApp.qvw I will not be taking the filesize of E:\Qlikview\folder\subfolder\application\InitLink.qvs, but the filesize of "E:\InitLink.qvd"

Similar using a network address. Running the script from  \\servername\folder\subfolder\application\MyApp.qvw the Filesize('/InitLink.qvs') will look for the size of \\servername\InitLink.qvs and not \\servername\folder\subfolder\application\InitLink.qvs.

We had accidentally put a InitLink.qvs file on E:/ which initiated this confusion.

View solution in original post

1 Reply
Vegar
MVP
MVP
Author

Issue solved. I'll explain for future reference.

I've missunderstood how Qlik interpreted the path that I used. 

Filesize('/InitLink.qvs') will point to the root of the drive that I am on. So when calling this function from the application E:\Qlikview\folder\subfolder\application\MyApp.qvw I will not be taking the filesize of E:\Qlikview\folder\subfolder\application\InitLink.qvs, but the filesize of "E:\InitLink.qvd"

Similar using a network address. Running the script from  \\servername\folder\subfolder\application\MyApp.qvw the Filesize('/InitLink.qvs') will look for the size of \\servername\InitLink.qvs and not \\servername\folder\subfolder\application\InitLink.qvs.

We had accidentally put a InitLink.qvs file on E:/ which initiated this confusion.