Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Jotaveve
Partner - Contributor II
Partner - Contributor II

Best practices for storing qvd files on Qlik Saas

Hi,

 

I am starting to work with Qlik SAAS and I am trying to understand what would be the right organization of my spaces.

In Qliksense on premise, I had a development server and a production server with the same folder structure and the connections to these folders had the same name on both servers. I did not need to change anything in the script to point to the right connection when I published my reports.

I am not quite sure how to do this in Qliksense Saas. I have created a space for development, one for testing, and one for production.

Am I supposed to store my qvd files in the same space as my qvf reports? Or am I supposed to have the qvd files in different spaces (one for development, one for testing, and the last one for production)? If I am supposed to have them in separate spaces, how can I put my space name in a variable to avoid changing the script from this:

Let MyConnection = 'lib://[MyDevSpaceForQVD]:DataFiles/'

to this

Let MyConnection = 'lib://[MyTestSpaceForQVD]:DataFiles/'

When I want to publish my report?

 

Labels (1)
  • SaaS

1 Solution

Accepted Solutions
Jotaveve
Partner - Contributor II
Partner - Contributor II
Author

Sorry, my question was probably not clear. After some research, I preferred to create different spaces for QVD's and QVF's so that end users only see the apps they are supposed to see and not QVD's.

I also found a rest connection to determine in which space my app is and I was able to variabilize my connection to datafiles.

View solution in original post

7 Replies
Daniel_Seo
Support
Support

Hello

Almost all of the available cloud storage connectors (for Amazon S3, Azure Storage, Google Drive and DropBox) can be used to store QVD's.

https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptRegularS...

Only the OneDrive connector doesn't support storing QVD's 

Thanks.

 

Jotaveve
Partner - Contributor II
Partner - Contributor II
Author

Sorry, my question was probably not clear. After some research, I preferred to create different spaces for QVD's and QVF's so that end users only see the apps they are supposed to see and not QVD's.

I also found a rest connection to determine in which space my app is and I was able to variabilize my connection to datafiles.

lvdbrink
Partner Ambassador
Partner Ambassador

Hi Jotaveve,

I am quite intrested in the method you use for an app to determine the space it is residing in. Could you perhaps share a code snippet or explain in more detail what endpoints you used?

Also might be good to know that you can use relative paths in your dataconnections. For example [lib://:DataFiles/Data.xlsx] would refer to the Data.xlsx file that resides in the same space as the app executing the script. See this article for more explanation on relative paths in Qlik Cloud: https://community.qlik.com/t5/Qlik-Design-Blog/Qlik-Sense-cloud-editions-Space-out-in-cloud-Protect-...

Jotaveve
Partner - Contributor II
Partner - Contributor II
Author

Hi,

You can use the following sub as is. You just need to define the two arguments and then call the sub like this:

SET tenantFQDN = 'mysaas.qlikcloud.com';
SET restConnection = 'Monitoring:REST for Entitlement Analyzer';

Call GetSpaceName('$(tenantFQDN)', '$(restConnection)');

Sub GetSpaceName(tenantFQDN,restConnection)

LET appName = DocumentName();
SET spaceName;

LIB CONNECT TO '$(restConnection)';

RestConnectorMasterTable:
SQL SELECT
	"__KEY_root",
	(SELECT
		"spaceId",
		"__FK_attributes"
FROM "attributes" PK "__KEY_attributes" FK "__FK_attributes")
FROM JSON (wrap on) "root" PK "__KEY_root"
WITH CONNECTION (
URL "https://$(tenantFQDN)/api/v1/apps/$(appName)"
);

[attributes]:
LOAD
	[spaceId]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_attributes]);

DROP TABLE RestConnectorMasterTable;

Let spaceId = Peek('spaceId');

drop Table attributes;

// If app is in a space
if '$(spaceId)' <> '' then

  RestConnectorMasterTable:
  SQL SELECT
  	"name",
  	"__KEY_root"
  FROM JSON (wrap on) "root" PK "__KEY_root"
  WITH CONNECTION (
  URL "https://$(tenantFQDN)/api/v1/spaces/$(spaceId)"
  );

  [root]:
  LOAD 
      [name]
  RESIDENT RestConnectorMasterTable
  WHERE NOT IsNull([__KEY_root]);

  DROP TABLE RestConnectorMasterTable;
  let spaceName = Peek('name');

	DROP TABLE root;
end if;

End Sub;

 

It returns a variable called spaceName with the name of the current space.

 

I knew about relative spaces but it didn't fit my customer's need as they wanted to have one space only for development and test data.

 

lvdbrink
Partner Ambassador
Partner Ambassador

Hi Jotaveve,

Thanks alot for the snippet. We are running into these same struggles as you are with spaces and relative paths. The solution we are currently exploring is using the relative path to load a config file using the include statement that then contains the reference to our DEV or PRD qvd space.

All of this would be much easier if Qlik allowed us to make a data connection to a specific space, but as of now that is sadly not possible.

mgranillo
Specialist
Specialist

This seems like a workaround. Is the standard process to store QVDs in the same space?

Jotaveve
Partner - Contributor II
Partner - Contributor II
Author

Good question. I am new to Qlik Cloud and I couldn't find anything about this particular topic on the help site. I want to separate qvds from qvfs in the space my users will connect to for security reasons and also to avoid that they get confused because they can see many different files when they connect to their space.

I figured there might be something to do with the different roles you can attribute but I have not been able to do it yet.