Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Join us March 10th, 7 Ways Modern Analytics Can Help You Take Smarter Action. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
guruprem
Partner
Partner

Using Include in Qlik Sense

Hi,

I am using QlikSense desktop in defalut mode (StandardReload=1). However when I use the include statement I am facing the error .

My Script:

$(Include = [lib://Scripts/CalendarSuperFast2014.txt] ) ;

Call Calendar('[Date]');

Here "Scripts" is the Folder Connection Name,  When I load, I am facing the following error

Script Error.PNG

1 Solution

Accepted Solutions
guruprem
Partner
Partner

Rob,

I got the solution but finding is a little strange i.e we should put "=" immediately after Include statement else QS is not recognizing the Include Statement.

Wrong way to use Include (Leaving the space after Include):

Wrong way to use Include.PNG

Correct syntax is:
Right Way to use Include.PNG

View solution in original post

10 Replies
NareshGuntur
Partner
Partner

Just interested in finding out why the single quotes are used.

If the argument is text, it will by default take it as a text value.

Hope you would have already trying without single quotes.

JonnyPoole
Employee
Employee

The error suggests its the 'Call' line that is erroring out. I would suggest putting two foward slashes (//) in front of the CALL line to see if it works. Then you will be sure its not the INCLUDE.

reddy-s
Master II
Master II

Hi Guruprem,

What does that the call statement take as input? I believe this is where the issue is.

rwunderlich
MVP & Luminary
MVP & Luminary

This probably indicates that the "Calendar" sub is not found, which means your include is not finding the file.

Change your Include to a Must_Include to confirm the file is found.

$(Must_Include = [lib://Scripts/CalendarSuperFast2014.txt] )


-Rob

http://masterssummit.com

http://qlikviewcookbook.com

guruprem
Partner
Partner

I am not sure what went wrong but same CALL statement is working fine , when I replaced include statement with actual routine. (I did not change CALL statement)

rwunderlich
MVP & Luminary
MVP & Luminary

That makes sense. The path to the include file was incorrect or the included file did not include a SUB named "Calendar". When you provided the SUB, the CALL works.

-Rob

guruprem
Partner
Partner

Rob,

I got the solution but finding is a little strange i.e we should put "=" immediately after Include statement else QS is not recognizing the Include Statement.

Wrong way to use Include (Leaving the space after Include):

Wrong way to use Include.PNG

Correct syntax is:
Right Way to use Include.PNG

View solution in original post

rwunderlich
MVP & Luminary
MVP & Luminary

Interesting. I still think you should also use Must_Include as that will tell you when the file is not found.

elena888
Specialist
Specialist

Thank you, I also had the same problem... you saved me