Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
didierodayo
Partner - Creator III
Partner - Creator III

Set Variable for On-Site /SaaS environment

Hi All,

is there a way to set a variable for the current environment during reload?

I have an app on premise which loads data from a QVD path vQVDPath = 'lib://ProdData/1.QVD/'

when I upload the same app to the SaaS environment I would like to be able to reload it without any change by adding something like

If  vEnvironment = SaaS then

Set vQVDPath = 'lib://Sales:DataFiles/';

else

Set  vQVDPath = 'lib://ProdData/1.QVD/'

End if

Or is there a better way to avoid changing the app once it is uploaded.

Labels (2)
1 Solution

Accepted Solutions
MayilVahanan

Hi @didierodayo 

Try with ComputerName() function, hope both are different and it will help you

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

4 Replies
didierodayo
Partner - Creator III
Partner - Creator III
Author

What I am doing at the moment is 

////|Prem | SaaS
Let vEnvironment = 'SaaS';

If '$(vEnvironment)' = 'SaaS' then

Set vQVDPath = 'lib://Sales:DataFiles/';

Else

Set  vQVDPath = 'lib://ProdData/1.QVD/'

EndIf

 

This works as long as I remember to switch between Prem and SaaS. That is why I am wondering if there is a systematic way to detect where the app is being reloaded?

 

thanks 

MayilVahanan

Hi @didierodayo 

Try with ComputerName() function, hope both are different and it will help you

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
didierodayo
Partner - Creator III
Partner - Creator III
Author

Hi Mayil,

 

I thought Computer might work but because it is cloud this can change without notice. I have posted an idea for a system variable to be defined that results in a fixed value. Hopefully Qlik it embraced.

https://community.qlik.com/t5/App-Development/Set-Variable-for-On-Site-SaaS-environment/m-p/1801612#...

 

MayilVahanan

Hi @didierodayo 

Okay, Hope Your OnPremise won't change often right, in that case, you can swap the if condition 

If  ComputerName()= 'OnPremiseCompName' then

Set  vQVDPath = 'lib://ProdData/1.QVD/';

else

Set vQVDPath = 'lib://Sales:DataFiles/';

End if

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.