1 Reply Latest reply: Mar 27, 2015 7:52 PM by Andrei Hes RSS

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

    Shivendoo Kumar

      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.