Qlikview - set up a global variable defining a server

344 Views Asked by At

Intro: Every QVW has their own variables that manually defined where to store/load the records they pulled in their SQL scripts.

ex:

SET vLoadPath = \\dev_server\Extract QVD\;
SET vStorePath = \\dev_server\Transform QVD\;

Scenario:

  • As Qlikview Admin, we promote tested QVWs from DEV to PROD environment.
  • Variable path is always hardcoded in DEV (see example code above)
  • When we promote the QVW in PROD, we will change the defined path variable to have a 'prod_server'.

Question:

Is there a way to make the sample variables above, be a Global variable? These variables will change its value when we promote the QVW from DEV to PROD environment.

Reason:

I think the manual changing of hardcoded path variable is a poor practice. What if the server should change? Or the subdirectory? Then you’ll have to go back into every single QVW script and change the hardcoded subdirectory path. Not only is that a high cost, it also introduces the possibility of error.

1

There are 1 best solutions below

0
On

The way I've generally handled such things is via a master config file. You $include (or probably $must_include) this file in all QVWs and it sets your environment variables. Make the path to the config file relative so when you deploy between environments the config file in the new environment is picked up.