Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Environment Variable setup in Qlikview (To Make connection string configurable) same as SSIS

Hi Guys,

I was just trying to make the path configurable so that when we move from Development to production environment, we should change the path only in configuration and should not open the code and change the path or connection string.

To Achieve this, I added all my configurable variables in a text file (qlikview_file_config.txt) and include that file in my script.

SET vDWHConnectionString='[Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=DB_NAME;Data Source=SERVER_NAME;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=ABC;Use Encryption for Data=False;Tag with column collation when possible=False]';

SET vDimQVDStoragePath='D:\Shivendoo\Dim Data Source QVD Files';

SET vFactQVDStoragePath='D:\Shivendoo\Fact Data Source QVD Files';

SET vBKPDimFolderPath='D:\Shivendoo\QVD BackUp\Dim Data Source QVD Files';

SET vBKPFactFolderPath='D:\Shivendoo\QVD BackUp\Fact Data Source QVD Files';

SET vArchieveQVDsFolderPath='D:\Shivendoo\Archieve QVDs';

//This condition will allow to load only 2 years of Data from Today()

SET vTwoYearsOldDate=DATE(Today()-735);

//Include the QlikView Configuration File

$(Include=d:\shivendoo\qlikview config\qlikview_file_config.txt);

//Get Connection String from QlikView Configuration File

OLEDB CONNECT TO $(vDWHConnectionString);

Still my purpose is not achieved and I am always forced to keep file qlikview_file_config.txt on d:\shivendoo\qlikview config\qlikview_file_config.txt in all the Environments.

In Case, In Test Env I have to keep on C:\shivendoo\qlikview config\qlikview_file_config.txt then I need to modify the code which I don't want.

Please help me in making it configurable using computer Environment Variable.

1 Solution

Accepted Solutions
Not applicable

Re: Environment Variable setup in Qlikview (To Make connection string configurable) same as SSIS

Hi,

1. Store your config file in same directory where you keep your QVW or in sub-directory, for example config

2. Do not point full paths in script, keep using relative paths:

$(Include=./qlikview_file_config.txt);

or

$(Include=./config/qlikview_file_config.txt);

3. In case you're not sure the QVW will be opened with a valid working directory, use QvWorkPath sys var:

$(Include=$(QvWorkPath)/config/qlikview_file_config.txt);

4. Use Must_Include instead of Include. This keep the brain safe against 'what happens and why this fails?' issues

1 Reply
Not applicable

Re: Environment Variable setup in Qlikview (To Make connection string configurable) same as SSIS

Hi,

1. Store your config file in same directory where you keep your QVW or in sub-directory, for example config

2. Do not point full paths in script, keep using relative paths:

$(Include=./qlikview_file_config.txt);

or

$(Include=./config/qlikview_file_config.txt);

3. In case you're not sure the QVW will be opened with a valid working directory, use QvWorkPath sys var:

$(Include=$(QvWorkPath)/config/qlikview_file_config.txt);

4. Use Must_Include instead of Include. This keep the brain safe against 'what happens and why this fails?' issues