<?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 Assign the Include file to a Variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Assign-the-Include-file-to-a-Variable/m-p/287769#M706444</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rob, Excellent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For anyone needing thisI did need to add (txt, no labels) so that the @1 would work because I didn't have column headings in the file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: 'courier new', courier; font-size: 12px; background-color: #ffffff;"&gt;LOAD @1 as conn FROM [$(vConnectionFilePath)] (txt, no labels);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: 'courier new', courier; font-size: 12px; background-color: #ffffff;"&gt;Thanks again Rob. &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Jan 2012 01:03:12 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-01-20T01:03:12Z</dc:date>
    <item>
      <title>Assign the Include file to a Variable</title>
      <link>https://community.qlik.com/t5/QlikView/Assign-the-Include-file-to-a-Variable/m-p/287767#M706442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi There,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought I could assign the Include file to a variable. I did a quick test but obviously didn't look at the result properly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET sConnectwiseConnectionString = $(Include=$(vConnectionFilePath));&lt;/P&gt;&lt;P&gt;LET sConnectwiseConnectionString = Replace($(sConnectwiseConnectionString), 'CONNECT TO','');&lt;/P&gt;&lt;P&gt;CONNECT TO $(sConnectwiseConnectionString);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Knowing that my file that is located at $(vConnectionFilePath) contains one line like below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONNECT TO [Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=myDB;Data Source=ServerName];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see that by using the LET syntax in the saved file it will save the connection to a variable. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g. LET sConnectwiseConnectionString = [Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=myDB;Data Source=ServerName];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$(Include=$(vConnectionFilePath));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As &lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://community.qlik.com/people/nstefaniuk" id="jive-5054215374690876526961" style="background-color: #f9f9f9; font-size: 12px; color: #007fc0; font-weight: bold; font-family: Arial; text-align: center;"&gt;nstefaniuk&lt;/A&gt; pointed out to me here but I didn't read it properly. &lt;A _jive_internal="true" href="https://community.qlik.com/thread/41760"&gt;http://community.qlik.com/thread/41760&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't have the option of changing the connection file as there are hundreds out there on various customer systems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way of getting the text in a file into a variable in the load script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope so&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2012 03:22:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Assign-the-Include-file-to-a-Variable/m-p/287767#M706442</guid>
      <dc:creator />
      <dc:date>2012-01-19T03:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: Assign the Include file to a Variable</title>
      <link>https://community.qlik.com/t5/QlikView/Assign-the-Include-file-to-a-Variable/m-p/287768#M706443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;temptab:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD @1 as conn FROM [$(vConnectionFilePath)] (txt);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LET vConnString = peek('conn');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;DROP TABLE temptab;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;CONNECT TO $(vConnString);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wasn't clear if your file contained the "CONNECT TO" portion. If it does, then you only need to put $(vConnString); on a line by itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2012 05:35:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Assign-the-Include-file-to-a-Variable/m-p/287768#M706443</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2012-01-19T05:35:48Z</dc:date>
    </item>
    <item>
      <title>Assign the Include file to a Variable</title>
      <link>https://community.qlik.com/t5/QlikView/Assign-the-Include-file-to-a-Variable/m-p/287769#M706444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rob, Excellent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For anyone needing thisI did need to add (txt, no labels) so that the @1 would work because I didn't have column headings in the file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: 'courier new', courier; font-size: 12px; background-color: #ffffff;"&gt;LOAD @1 as conn FROM [$(vConnectionFilePath)] (txt, no labels);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: 'courier new', courier; font-size: 12px; background-color: #ffffff;"&gt;Thanks again Rob. &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jan 2012 01:03:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Assign-the-Include-file-to-a-Variable/m-p/287769#M706444</guid>
      <dc:creator />
      <dc:date>2012-01-20T01:03:12Z</dc:date>
    </item>
  </channel>
</rss>

