Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hallo community,
we have one tenant, that must be used both as production environment and developent one.
As production environment we have defined two managed spaces: "SpaceA" and "SpaceA_DataConnection".
As development environment we have defined two shared spaces: "DEV_SpaceA" and "DEV_SpaceA_DataConnection".
In order to publish apps automatically, we need to identity the Space Name, so that we would be able to parametrize all paths' variables.
We expect to write a script such as:
Let vs_SpaceName = ???;
if(left('$(vs_SpaceName)',3)='DEV') then
ConnectionPrefix='DEV_';
else
ConnectionPrefix='';
End if
Let vs_pathDwStaging = 'lib://$(ConnectionPrefix)SpaceA_DataConnection:Staging';
Many thanks and best regards,
Elena
Hello Elena,
The function GetSysAttr() will return you some information about your system.
For your scenario, the argument of the function must be 'SpaceName'.
So let a variable be like "=GetSysAttr('spaceName')".
Find more here .
Federico.
Looks interesting.
Hi,
below I post the solution my colleague and I have implemented this morning. You will notice that we need to point to .qvd saved by the monitoring app "Events Monitoring" (rif. https://community.qlik.com/t5/Official-Support-Articles/The-Qlik-Sense-Monitoring-Applications-for-C... ).
Let vs_DocumentName = DocumentName();
SpaceDetails:
LOAD
AppID,
SpaceID
FROM [lib://Monitoring Apps Data:DataFiles/Apps.qvd]
(qvd)
where AppID = '$(vs_DocumentName)'
;
left join (SpaceDetails)
LOAD
SpaceID,
"Space Name" as SpaceName
FROM [lib://Monitoring Apps Data:DataFiles/Spaces.qvd]
(qvd);
let vs_SpacePrefix = left(peek('SpaceName', 0, 'SpaceDetails'),3);
If('$(vs_SpacePrefix)' = 'DEV') then
let vs_ConnectionPrefix = 'DEV_';
else
let vs_ConnectionPrefix = '';
end if
drop table SpaceDetails;
Let vs_DocumentName = Null();
Let vs_SpacePrefix = Null();
Have anyone a best solution without using .qvd created by monitoring apps (and without REST connection), but using something like "ComputerName()" in enterprise environments?
Many thanks,
Elena
you will get some info in this link as well..
Hi Anat,
Many thanks for the suggestion.
In the post you have linked the difference between DEV and PROD environment is made also in app's name, that's why it is not necessary to know the space's name. This is an idea, but we like to follow another strategy to separe DEV and PROD environment.
Best regards,
Elena
Hello Elena,
The function GetSysAttr() will return you some information about your system.
For your scenario, the argument of the function must be 'SpaceName'.
So let a variable be like "=GetSysAttr('spaceName')".
Find more here .
Federico.