Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Partner
Partner

Qlik Sense Desktop: Load from path

Hi

In Qlik Sense Desktop 0.96 I was able to load an excel file using a variable for the path

let vFolderPath = 'C:\MasterFiles\';

Table1:

LOAD *

FROM $(vFolderPath)MyFile.xlsx (ooxml, embedded labels, table is Sheet1);

I upgraded to Qlik Sense Desktop 1.0.0 Build 21.ms8 and when I reload this now I get the following error message:

LOAD statement only works with lib:// paths in this script mode

So my question is:

From Qlik Sense Desktop version 1 onwards, must you create a Folder Data Connection?

Is there still a way to load a file using a FROM statement with a variable pointing to the path (rather than using a folder connection library). The reason I'm asking this is because when I share a app to another user I want to allow the user to simply change the path in the variable (use a trick or two for this to minimize user input) to allow that user to also load data from a file without having to edit the folder connection

1 Solution

Accepted Solutions
Highlighted
Creator
Creator

Hi Jan-Hendrik,

I have experienced the same issues with my 0.96 Qlik Sense apps as well.  What I did for a work around for version 1.0 was to create a Lib path for the data sources, and modified the script variable to accommodate the new change.

Example:

Create a new Folder Data Connection in the script editor that points to the master files and give it a name. (For this case, we'll call the connection "FilePath")

Replace the LET command in the beginning of your script with this new description:

LET vFolderPath = 'lib://FilePath/';

That's it!  No need to change any of the original table loads if they are all using the vFolderPath variable in the FROM statements.

Cheers,

Sean

View solution in original post

10 Replies
Highlighted
Employee
Employee

Yes, you must use Lib paths for your data sources.

Notice that the Lib refers to a connection name, not the actual file path. This means that when opened on an other machine, the developer can simply change the folderpath in the preferred Lib and it will apply on all references to that Lib.

Highlighted
Creator
Creator

Hi Jan-Hendrik,

I have experienced the same issues with my 0.96 Qlik Sense apps as well.  What I did for a work around for version 1.0 was to create a Lib path for the data sources, and modified the script variable to accommodate the new change.

Example:

Create a new Folder Data Connection in the script editor that points to the master files and give it a name. (For this case, we'll call the connection "FilePath")

Replace the LET command in the beginning of your script with this new description:

LET vFolderPath = 'lib://FilePath/';

That's it!  No need to change any of the original table loads if they are all using the vFolderPath variable in the FROM statements.

Cheers,

Sean

View solution in original post

Highlighted
Partner
Partner

Thx guys!

Highlighted
Creator
Creator

To follow up, what if my files are stored on a different drive (i.e. drive mapping?) - How do I define it with 'Lib' ?

LET vFolderPath = 'D://FilePath/';

Highlighted
Creator
Creator

that is, the drivepath is for a different machine, not under my C: drive

Highlighted
Partner
Partner

Hi

Suggest you create a new folder connection and then type in the mapped drive (press enter after typing in mapped drive)

then defining variable in same way

pic.png

Highlighted
Creator
Creator

Jan,

Hey, thanks for the feedback... that gets me half-say, Qlik Sense can logically see the files... in my QVD directory.

It can even create the load script...

.

LOAD

    "Field1",

    "Field2", .... etc.

FROM [lib://X/corebio.qvd] (qvd);

However, when I run this, I get:

err1.JPG

I have also tried: 

LOAD * from 'X:\corebio.qvd' (qvd)

LOAD * from 'X:\\corebio.qvd' (qvd)

LOAD * from 'X:\Custom\corebio.qvd' (qvd)

LOAD * from 'X:\\Custom\corebio.qvd' (qvd)

Here is my Path definition:

conn.JPG

             ... etc, more .qvd files... corbio.qvd, etc.

Highlighted
Specialist II
Specialist II

Hi Jarell,

Be careful, if you are using Qlik Sense Server Edition, the username will be added to data connection name automatic.

If you want use absolute path instead of lib connection you should disable the standard mode.

Disabling standard mode ‒ Qlik Sense

G.

Highlighted
Champion
Champion

In simple worlds Creating a folder  by providing the path

from script editor-> Create new connection-> Give the name and path of folder here

then fetch excel from the connected folder

it will auto take Lib path.