Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Qlik Sense Desktop - Cannot Include using Relative filepath unless in Legacy Mode

Both of these statements (which , by my understanding, use "relative paths") will cause a failure:

$(Include=test.qvs);

$(Include=../test.qvs);

The error message is vague, there is no specific "error" I can see other than this mentioned in the Data Load Editor output:

"Data has not been loaded. Please correct the error and try loading again."

(Even though there are two test.qvs at those locations...

Which are relative to the Qlik sense working directory, and its parent directory, which -- as this suggests -- are here for me:

C:\Users\nathanielanderson\Documents\Qlik\Sense\Apps\test.qvs

C:\Users\nathanielanderson\Documents\Qlik\Sense\test.qvs

)

Actually, these statements (which, by my understanding, use "absolute paths")  DO work:

$(Include=C:\Users\nathanielanderson\Documents\Qlik\Sense\Apps\test.qvs);

$(Include=C:\Users\nathanielanderson\Documents\Qlik\Sense\test.qvs);

Until I  make this change in my Settings.ini :

StandardReload=0


After making that change -- ie. turning OFF Standard mode; turning ON legacy mode...

Then no errors with the relative paths or otherwise.


Maybe I must look in the "script log files"?



1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Qlik Sense distinguishes between legacy and standard mode, QlikView does not, only works with paths, not LIBs.

Indeed, in Qlik Sense, you can use LIBs pointing to a folder structure, or you can use a relative or absolute path, the latter as long as the legacy mode is enabled.

As for the issue of Desktop not reading the StandardReload = 0, since it is using an ini file, make sure Desktop is closed, then the modification is done in the ini file, then Desktop is open again.

View solution in original post

19 Replies
Not applicable
Author

Ah! After checking my log file, which was located here:

C:\Users\nathanielanderson\Documents\Qlik\Sense\Log\{NameOfApp}.2016_12_30_03_36_53.72FAC0126907D3E08BF5.log

I could see a specific error message:

2016-12-29 20:36:53      No qualified path for file: "../test.qvs"

2016-12-29 20:36:53      Execution Failed

2016-12-29 20:36:53      Execution finished.

By the way, it does work if I add the folder to my connections first, then use "lib:\\" notation:

$(Include=lib://Apps/test.qvs);

Not applicable
Author

Also worth noting that the same script will work in Qlikview with no problems:

$(Include=test.qvs);

$(Include=../test.qvs);

Since Qlikview uses a "legacy" mode this reinforces the idea that "legacy mode" (StandardReload=0) is the fix I want;

Now my only concern is that the "standard mode vs legacy mode" documentation suggests that absolute paths wouldn't work..

to reuse QlikView load scripts that refer to absolute or relative file paths as well as library connections.

And yet, for me, absolute paths (as well as "lib paths") did work even in Qlik Sense with StandardReload=1

Miguel_Angel_Baeyens

Qlik Sense distinguishes between legacy and standard mode, QlikView does not, only works with paths, not LIBs.

Indeed, in Qlik Sense, you can use LIBs pointing to a folder structure, or you can use a relative or absolute path, the latter as long as the legacy mode is enabled.

As for the issue of Desktop not reading the StandardReload = 0, since it is using an ini file, make sure Desktop is closed, then the modification is done in the ini file, then Desktop is open again.

Not applicable
Author

Ah, I see now, Absolute paths actually have NOT been working for me... they just haven't failed explicitly (they fail silently)

For example, if the contents of test.qvs are:

SET vTestQvsVal = fake_outer_newer_12_30_2016_2;

And I run this script:

$(Include=C:\Users\nathanielanderson\Documents\Qlik\Sense\test.qvs);

The script load logs prints this line; i.e. it did NOT include test.qvs (absolute paths don't work in standard mode) NOR did it print an error about the problem:

2016-12-30 08:25:42      Execution finished.

But if I run this script instead, or in addition to the above:

$(Include=lib://WorkingDirectory/test.qvs);

The script load logs print this line; i.e. it DID include test.qvs:

2016-12-30 08:27:03 0031 SET vTestQvsVal = fake_outer_newer_12_30_2016_2

2016-12-30 08:27:03      Execution finished.

Miguel_Angel_Baeyens

Fail silently, indeed: https://help.qlik.com/en-US/sense/3.1/Subsystems/Hub/Content/Scripting/SystemVariables/Include.htm

The fail itself, it seems it is not reading the right .ini file or ignoring the setting of StandardReload. It does work for me.

On a different note, you have posted this in the QlikView area, not the Qlik Sense section. I recommend you to move it there so more people or even Qlik Support can chime in.

Not applicable
Author

Qlik Sense is very API-oriented; I love that. So with everything I learn in Qlik Sense , I ask, is there an API call for that, in case I need to automate it or build it into a bigger app?

For instance, to create a connection (so I can use the "lib://") notation, I can use CreateConnection.

Is there a way to modify Settings.ini (or whatever is the equivalent for a Server installation of Qlik Sense), specifically setting StandardReload=1 or StandardReload=0, using an API?

For instance, could this be it?

Miguel_Angel_Baeyens

I don't think that would work in Desktop even if there is an endpoint for that, because although technically the Desktop is using a QIX engine, it does not listen to APIs by design (i.e: it is not a proper Qlik Sense server).

In the server, it is not possible (yet) to do it via API, as far as I know.

Not applicable
Author

mbaeyens‌ -- I moved it, but now I can't reply to you directly...

Oh! I see Miguel's point: I didn't notice it literally says "fail silently":

  • Include does not generate an error if the file cannot be found, it will fail silently.

Then I don't know why it "fails loudly" when I use a relative path:

"Data has not been loaded. Please correct the error and try loading again."

Not even using "." or "..", just directly looking inside working directory, exactly as shown on that documentation:

$(Include=abc.txt);

And the log shows:

2016-12-30 08:40:59      No qualified path for file: "abc.txt"

I think I have been carefully changing Settings.ini and restarting Qlik Sense, per your instructions. I'm convinced there is just inconsistent treatment of absolute path vs relative path until I hear more.

Not applicable
Author

Yeah, in fact if I do use Must_Include, it gives me clear error message for absolute...

$(Must_Include=C:\Users\nathanielanderson\Documents\Qlik\Sense\test.qvs);

The following error occurred:

"$(INCLUDE= " cannot access the local file system in current script mode. Try including with LIB path

The error occurred here:

?

But still the same old message when I use relative:

$(Must_Include=test.qvs);

Data has not been loaded. Please correct the error and try loading again.

(And in the log:

2016-12-30 08:46:52      No qualified path for file: "test.qvs")