Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Why doesn't this cmd work?

Hi everyone,

I'm sorry for my trivial question but i'm a beginner...

Why doesn't this cmd work?

$(include='lib://C:/.../Sense/Apps/Script.txt');

In 'Script.txt' I wrote a simple SQL sentence:

Products:
select ITEM AS Code,

NMPIAN AS Number

from Articles where Category='WIP';

Thanks,

G.

1 Solution

Accepted Solutions
Michael_Tarallo
Employee
Employee

Hi Gio - I assume you mean for Qlik Sense? If so this is because -Standard Mode - which uses a different approach for access data on file systems. (connection names)  There is no need to use the drive letter - you need to create a folder connection first and then reference the folder connection name:

Your script should look like this.

$(include=lib://data\myfile.txt);

The help document is located here:

http://help.qlik.com/sense/en-US/online/#../Subsystems/Hub/Content/Scripting/SystemVariables/Include...

If you want to use the statement the way it was used in QlikView - using the drive letter and directory path - you must disable standard mode:

http://help.qlik.com/sense/en-US/online/#../Subsystems/Hub/Content/LoadData/DisableStandardMode.htm?...

Let us know how you do.

Please mark the appropriate replies as CORRECT / HELPFUL so our team and other members know that your question(s) has been answered to your satisfaction.

Regards,

Mike Tarallo

Qlik

Regards,
Mike Tarallo
Qlik

View solution in original post

5 Replies
brian_booden
Partner Ambassador
Partner Ambassador

Hi Gio,

What is the error you are getting?

First thing to note is that your SQL needs to be preceded by the SQL command in Qlik Sense to be able to run, for example:

Products:

SQL

select ITEM AS Code,

NMPIAN AS Number

from Articles where Category='WIP';

Have you created a new Data connection to the Data Source?

Regards,

Brian

Michael_Tarallo
Employee
Employee

Hi Gio - I assume you mean for Qlik Sense? If so this is because -Standard Mode - which uses a different approach for access data on file systems. (connection names)  There is no need to use the drive letter - you need to create a folder connection first and then reference the folder connection name:

Your script should look like this.

$(include=lib://data\myfile.txt);

The help document is located here:

http://help.qlik.com/sense/en-US/online/#../Subsystems/Hub/Content/Scripting/SystemVariables/Include...

If you want to use the statement the way it was used in QlikView - using the drive letter and directory path - you must disable standard mode:

http://help.qlik.com/sense/en-US/online/#../Subsystems/Hub/Content/LoadData/DisableStandardMode.htm?...

Let us know how you do.

Please mark the appropriate replies as CORRECT / HELPFUL so our team and other members know that your question(s) has been answered to your satisfaction.

Regards,

Mike Tarallo

Qlik

Regards,
Mike Tarallo
Qlik
Michael_Tarallo
Employee
Employee

BTW - as an example - this is the correct script generated by the Connection / Data Select wizard when accessing a SQL data source.:

LIB CONNECT TO 'localhost';

LOAD ProductID,

    CategoryID,

    ProductName,

    SupplierID;

SQL SELECT ProductID,

    CategoryID,

    ProductName,

    SupplierID

FROM GettingStarted.dbo."GSW_Products";

see attached.

Mike

Regards,
Mike Tarallo
Qlik
Not applicable
Author

Thanks a lot!

Now I understood the correct syntax.

Michael_Tarallo
Employee
Employee

Cool - note - you rarely need to write this syntax as the select wizard inserts it for you.

Regards,
Mike Tarallo
Qlik