<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Dynamic connection for ODBC in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Dynamic-connection-for-ODBC/m-p/1013892#M343879</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i know it works that way, but the LOAD statement is too big and the same load statement is repeated three time in my case, the only change is one folder name in the path. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there is a way to only change the FROM clause. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can we put the LOAD statement as a string and execute in IF-ELSE statement using variables. just like we execute in PL/SQL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 01 Feb 2016 09:49:26 GMT</pubDate>
    <dc:creator>ashishtams</dc:creator>
    <dc:date>2016-02-01T09:49:26Z</dc:date>
    <item>
      <title>Dynamic connection for ODBC</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-connection-for-ODBC/m-p/1013885#M343872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using odbc connetion to DB2 database to access the tables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we need qlikview to connect automatically to that environment where the dashboard is. Like if its in QA then it should connect to QA database and if the dashboard is in prod then it should connect to prod database. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so what i have is below statement in dev environment. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ODBC CONNECT TO DEV_UNIT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when i move the dashboard to prod i have to change this to below statement manually and then move the dashboard to prod&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;ODBC CONNECT TO PROD_UNIT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;how can i make this dynamic? &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jan 2016 09:30:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-connection-for-ODBC/m-p/1013885#M343872</guid>
      <dc:creator>ashishtams</dc:creator>
      <dc:date>2016-01-18T09:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic connection for ODBC</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-connection-for-ODBC/m-p/1013886#M343873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If &lt;STRONG&gt;Computername&lt;/STRONG&gt;() ='YourDEV' Then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ODBC CONNECT TO DEV_UNIT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else If&amp;nbsp; Computername() ='YourPROD' Then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 13.33px;"&gt;ODBC CONNECT TO PROD_UNIT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.33px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.33px;"&gt;End If&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jan 2016 09:34:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-connection-for-ODBC/m-p/1013886#M343873</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2016-01-18T09:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic connection for ODBC</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-connection-for-ODBC/m-p/1013887#M343874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming the user details to connect to the database are the same. You can change the ODBC connection name on all servers to be the same, then the script wouldn't need to worry which server it is on.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jan 2016 10:14:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-connection-for-ODBC/m-p/1013887#M343874</guid>
      <dc:creator>quwok</dc:creator>
      <dc:date>2016-01-18T10:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic connection for ODBC</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-connection-for-ODBC/m-p/1013888#M343875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While creating the ODBC connection in Test or PRD have same name for both the ODBC DSN connection in the server i.e. in the PRD with PRD credentials and in test with&amp;nbsp; test &lt;SPAN style="font-size: 13.3333px;"&gt;credentials and remove the string part after the connection name ..so the ODBC names remains same and no need to change &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jan 2016 10:20:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-connection-for-ODBC/m-p/1013888#M343875</guid>
      <dc:creator>avinashelite</dc:creator>
      <dc:date>2016-01-18T10:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic connection for ODBC</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-connection-for-ODBC/m-p/1013889#M343876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can also use an include statement to read unique connection info from each server.&amp;nbsp; This would require a unique file with the same name on each server.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jan 2016 14:01:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-connection-for-ODBC/m-p/1013889#M343876</guid>
      <dc:creator>dgreenberg</dc:creator>
      <dc:date>2016-01-18T14:01:31Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic connection for ODBC</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-connection-for-ODBC/m-p/1013890#M343877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used your suggestion and it worked for me&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, i want to use the same thing in the FROM clause in the script. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;EMP,&lt;/P&gt;&lt;P&gt;DEPT,&lt;/P&gt;&lt;P&gt;SAL&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;\\abcd\123\PROD\qvd\file.QVD&lt;/P&gt;&lt;P&gt;(qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now to make this dynamic when I connect to PROD the above statement is good. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but when i connect to QA then the from clause should be like &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;\\abcd\123\QA\qvd\file.QVD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;and for DEV it should be like &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;\\abcd\123\DEV\qvd\file.QVD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;so the folder is changing in the path where the QVD files are stored as per the environment.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;i tried to put the entire path in a variable using LET and then use IF ELSE after the FROM clause. but thats not working for me&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;please suggest&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Feb 2016 09:27:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-connection-for-ODBC/m-p/1013890#M343877</guid>
      <dc:creator>ashishtams</dc:creator>
      <dc:date>2016-02-01T09:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic connection for ODBC</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-connection-for-ODBC/m-p/1013891#M343878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try putting the entire load statement in the IF clause, like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If Computername()=.... Then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; From &lt;STRONG&gt;Path1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; From &lt;STRONG&gt;Path2&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Feb 2016 09:41:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-connection-for-ODBC/m-p/1013891#M343878</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2016-02-01T09:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic connection for ODBC</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-connection-for-ODBC/m-p/1013892#M343879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i know it works that way, but the LOAD statement is too big and the same load statement is repeated three time in my case, the only change is one folder name in the path. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there is a way to only change the FROM clause. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can we put the LOAD statement as a string and execute in IF-ELSE statement using variables. just like we execute in PL/SQL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Feb 2016 09:49:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-connection-for-ODBC/m-p/1013892#M343879</guid>
      <dc:creator>ashishtams</dc:creator>
      <dc:date>2016-02-01T09:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic connection for ODBC</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-connection-for-ODBC/m-p/1013893#M343880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can alternatively try like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vPath= If(ComputerName()='XXX', 'Path1' , 'Path2');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;/P&gt;&lt;P&gt;From '$(vPath)';&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Feb 2016 10:24:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-connection-for-ODBC/m-p/1013893#M343880</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2016-02-01T10:24:55Z</dc:date>
    </item>
  </channel>
</rss>

