<?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 Conditional ODBC selection in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Conditional-ODBC-selection-in-script/m-p/1246688#M395217</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to load my data from 2 different datasources by made of an external flag; I wrote an external TXT file where I stored a number which indicates the firm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My external Ditta.txt file contains only:&lt;/P&gt;&lt;P&gt;SET Ditta=0;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;SET Ditta=1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the script I used;&lt;/P&gt;&lt;P&gt;$(include=Ditta.txt);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I have the value 0 for the first firm or the value 1 for the second one in the variable Ditta and then I need to use it to redirect the ODBC, but I'm not able to do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone help me, please?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;N.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Jan 2017 12:46:12 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-01-27T12:46:12Z</dc:date>
    <item>
      <title>Conditional ODBC selection in script</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-ODBC-selection-in-script/m-p/1246688#M395217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to load my data from 2 different datasources by made of an external flag; I wrote an external TXT file where I stored a number which indicates the firm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My external Ditta.txt file contains only:&lt;/P&gt;&lt;P&gt;SET Ditta=0;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;SET Ditta=1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the script I used;&lt;/P&gt;&lt;P&gt;$(include=Ditta.txt);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I have the value 0 for the first firm or the value 1 for the second one in the variable Ditta and then I need to use it to redirect the ODBC, but I'm not able to do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone help me, please?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;N.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jan 2017 12:46:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-ODBC-selection-in-script/m-p/1246688#M395217</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-01-27T12:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional ODBC selection in script</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-ODBC-selection-in-script/m-p/1246689#M395218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IF $(Ditta) = 0 THEN&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set vConnect = 'Your 0 connection string';&lt;/P&gt;&lt;P&gt;ELSE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set vConnect = 'Your 1 connection string';&lt;/P&gt;&lt;P&gt;END&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ODBC CONNECT TO $(vConnect);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jan 2017 13:10:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-ODBC-selection-in-script/m-p/1246689#M395218</guid>
      <dc:creator>m_woolf</dc:creator>
      <dc:date>2017-01-27T13:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional ODBC selection in script</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-ODBC-selection-in-script/m-p/1246690#M395219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rather than using the include file to set a flag, followed by logic in the model to interpret the flag, why not simplify things by putting the connection string in the include file instead (one per include file)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Oh, and I would use must_include instead of include, so that a missing include file causes an error in the correct place, rather some obscure later error caused by the missing include file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jan 2017 13:24:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-ODBC-selection-in-script/m-p/1246690#M395219</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2017-01-27T13:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional ODBC selection in script</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-ODBC-selection-in-script/m-p/1246691#M395220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;IF $(Ditta) = 0 THEN&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Connection String for Ditta=0 // ODBC .....&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;ELSE&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Connection String for Ditta=1 // ODBC .....&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;ENDIF&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Edit : corrected syntax&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jan 2017 13:32:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-ODBC-selection-in-script/m-p/1246691#M395220</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2017-01-27T13:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional ODBC selection in script</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-ODBC-selection-in-script/m-p/1246692#M395221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the reply; closing the instruction with END it returns a syntax error; I used ENDIF and it works properly &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jan 2017 13:54:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-ODBC-selection-in-script/m-p/1246692#M395221</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-01-27T13:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional ODBC selection in script</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-ODBC-selection-in-script/m-p/1246693#M395222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the suggestion; I have to make a little modification to my scripts to apply everywhere!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jan 2017 13:56:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-ODBC-selection-in-script/m-p/1246693#M395222</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-01-27T13:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional ODBC selection in script</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-ODBC-selection-in-script/m-p/1246694#M395223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah, that was syntax error. Btw, I have edited my response. Thanks for marking it as correct.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jan 2017 14:02:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-ODBC-selection-in-script/m-p/1246694#M395223</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2017-01-27T14:02:09Z</dc:date>
    </item>
  </channel>
</rss>

