Skip to main content
Announcements
Happy New Year! Cheers to another year of collaboration, connections and success.
cancel
Showing results for 
Search instead for 
Did you mean: 
_Johan
Partner - Contributor III
Partner - Contributor III

How can I add qvd-files with data manager automatically depending on which space my app resides in?

Hi,

In my app I want to use qvd-files from the space where the app is located. I.e when the app is in shared space the qvd-files resides in shared space and when the app is in managed space it should use the qvd-files in the managed space. And I don't want to change the app once it is in managed space.

This can be solved by manually adding this in the script:

Let vSpaceType = GetSysAttr('spaceType');

// Figure out if this is shared or managed space
if vSpaceType = 'shared' then
Let vQvdExtractPath = 'lib://MySharedSpace:DataFiles/';
else
Let vQvdExtractPath = 'lib://MyManagedSpace:DataFiles/';
end if;

Data:
LOAD *
FROM [$(vQvdExtractPath)MyExtractedData.qvd]
(qvd);


But how can I set this when I fetch data automatically with data manager?


Kind regards
Johan

Labels (2)
2 Solutions

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Using just a colon for space in the lib path means use the space where this app is located.  In your example, the syntax would be:

LOAD *
FROM [lib://:DataFiles/MyExtractedData.qvd]

Note the ":" before DataFiles. 

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com

View solution in original post

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

The same path syntax should work in the auto generated section. If you edit the auto section, I believe you will not be able to use the data manager on that section again. I'm not sure if you can synchronize back again, haven't tried it. 

In my experience the Data Manager is a great "getting started" tool, but imposes constraints you will want to get away from pretty quickly.  

-Rob

View solution in original post

4 Replies
_Johan
Partner - Contributor III
Partner - Contributor III
Author

Is this solved by adding the tables manually in the load script and then by "Analyze load script" and "Synchronize scripted tables" in Data manager?

Before "Synchronize scripted tables" it says "Do not synchronize your scripted tables if your scripts contain Exit statements or dynamic fields". What is a dynamic field?

Kind regards
Johan

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Using just a colon for space in the lib path means use the space where this app is located.  In your example, the syntax would be:

LOAD *
FROM [lib://:DataFiles/MyExtractedData.qvd]

Note the ":" before DataFiles. 

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com

_Johan
Partner - Contributor III
Partner - Contributor III
Author

Hi Rob,

That is a nice feature.

The follow up question now then is how do I get that into the path of the "Auto-generated section" in the load script that is locked by the "Data manager"?
How much can I play around in the auto generated script part without something breaking?  

Kind regards
Johan

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

The same path syntax should work in the auto generated section. If you edit the auto section, I believe you will not be able to use the data manager on that section again. I'm not sure if you can synchronize back again, haven't tried it. 

In my experience the Data Manager is a great "getting started" tool, but imposes constraints you will want to get away from pretty quickly.  

-Rob