Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
johncahillhp
Contributor III
Contributor III

Line Script Error with Variables in File Functions

Hello,

I am seeing an issue with my script intended to identify file existence. I picked up some code outlined in this post: http://community.qlik.com/thread/85612

My code is fairly straight forward. Both of the attempts to set the variable provide the same error "Script line error".

QVD_PATH="../../../QVD/WW/ICM/";

Let fQVD_AAEData= fldQVD & 'AAEData.qvd';

Let vqvdexists = if(FileSize($(fQVD_ICMLog))>0,-1,0);

If FileSize($(fQVD_ICMLog))>0 Then
Let vqvdexists = -1;
Else
Let vqvdexists = 0;
End If

However when I use the resolved value instead of the variable it works.

Let vqvdexists = if(FileSize('../../../QVD/WW/ICM/AAEData.qvd')>0,-1,0);

I have tried other File functions such as QVDCreatetime with the same result.

What am I missing?

John

1 Solution

Accepted Solutions
Anonymous
Not applicable

try adding single quotes around your dollar expansion, as in :

Let vqvdexists = if(FileSize('$(fQVD_ICMLog)')>0,-1,0);

View solution in original post

2 Replies
Anonymous
Not applicable

try adding single quotes around your dollar expansion, as in :

Let vqvdexists = if(FileSize('$(fQVD_ICMLog)')>0,-1,0);

johncahillhp
Contributor III
Contributor III
Author

Thank you Bill, that’s what I was missing!