<?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 AW:Problem creating a ODBC Connect string to loop through in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-creating-a-ODBC-Connect-string-to-loop-through/m-p/237488#M88543</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi dendraw,&lt;/P&gt;&lt;P&gt;the value of your ConnectStr is (according to the LET of For..next) "connect1" or "connect2". But you want to get the value of the variable "connect1" or "connect2". So you need an additional statement (variable, sorry for the name ) like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;For iCount = 1 to 2&lt;BR /&gt;LET TT= 'Connect' &amp;amp; iCount;&lt;BR /&gt;LET ConnectStr= $(TT);&lt;BR /&gt;//ODBC CONNECT TO [$(ConnectStr)];&lt;BR /&gt;//SELECT {Select Code}&lt;BR /&gt;Next&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Regards, Roland&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 May 2011 16:52:36 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-05-02T16:52:36Z</dc:date>
    <item>
      <title>Problem creating a ODBC Connect string to loop through</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-creating-a-ODBC-Connect-string-to-loop-through/m-p/237487#M88542</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have several databases with the same structure that I want to loop through instead of repeating the same code. I've tried the following code but get a 'Data source name not found ....' error message. Any ideas welcome or alternative method.&lt;/P&gt;&lt;P style="line-height: normal; margin: 0cm 0cm 10pt; padding-left: 30px; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"&gt;[Code]&lt;BR /&gt;SET Connect1 = 'abz (XUserId is abc, XPassword is zxz)';&lt;BR /&gt;SET Connect2 = 'sca (XUserId is abc, XPassword is xyz)';&lt;BR /&gt;LET iCount =1;&lt;/P&gt;&lt;P style="line-height: normal; margin: 0cm 0cm 10pt; padding-left: 30px; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"&gt;For iCount = 1 to 2&lt;BR /&gt;LET ConnectStr = 'Connect' &amp;amp; iCount;&lt;/P&gt;&lt;P style="line-height: normal; margin: 0cm 0cm 10pt; padding-left: 30px; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"&gt;ODBC CONNECT TO [$(ConnectStr)];&lt;BR /&gt;SELECT {Select Code}&lt;/P&gt;&lt;P style="line-height: normal; margin: 0cm 0cm 10pt; padding-left: 30px; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto;"&gt;Next&lt;BR /&gt; [/Code]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2011 15:26:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-creating-a-ODBC-Connect-string-to-loop-through/m-p/237487#M88542</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-05-02T15:26:15Z</dc:date>
    </item>
    <item>
      <title>AW:Problem creating a ODBC Connect string to loop through</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-creating-a-ODBC-Connect-string-to-loop-through/m-p/237488#M88543</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi dendraw,&lt;/P&gt;&lt;P&gt;the value of your ConnectStr is (according to the LET of For..next) "connect1" or "connect2". But you want to get the value of the variable "connect1" or "connect2". So you need an additional statement (variable, sorry for the name ) like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;For iCount = 1 to 2&lt;BR /&gt;LET TT= 'Connect' &amp;amp; iCount;&lt;BR /&gt;LET ConnectStr= $(TT);&lt;BR /&gt;//ODBC CONNECT TO [$(ConnectStr)];&lt;BR /&gt;//SELECT {Select Code}&lt;BR /&gt;Next&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Regards, Roland&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2011 16:52:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-creating-a-ODBC-Connect-string-to-loop-through/m-p/237488#M88543</guid>
      <dc:creator />
      <dc:date>2011-05-02T16:52:36Z</dc:date>
    </item>
    <item>
      <title>AW:Problem creating a ODBC Connect string to loop through</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-creating-a-ODBC-Connect-string-to-loop-through/m-p/237489#M88544</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Roland&lt;/P&gt;&lt;P&gt;Many thanks. I had to also remove the square brackets from around the string. Work great now. &lt;IMG alt="Smile" src="http://community.qlik.com/emoticons/emotion-1.gif" /&gt;. Right now I'm not sure why it has to be done to get the value of the variable but will work that through.&lt;/P&gt;&lt;P&gt;Regards, Dave Andrew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2011 18:21:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-creating-a-ODBC-Connect-string-to-loop-through/m-p/237489#M88544</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-05-02T18:21:35Z</dc:date>
    </item>
  </channel>
</rss>

