<?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 Qlik: Loading from Flat Files based on environment in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Qlik-Loading-from-Flat-Files-based-on-environment/m-p/709920#M672694</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 have a requirement to load data from a flat file based on the environment the reload is happening in. Is there a way to achieve this? I was searching through the forum and found a few posts that talk about different connections based on environment / computer name:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the connection, the suggestion from @&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-weight: bold;"&gt;Ralf Becher &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;on another post &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;was to use something like this: &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;if ComputerName() = 'COMPUTER_A' then&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CONNECT DB1....;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;elseif ComputerName() = 'COMPUTER_B' then&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CONNECT DB2....;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;else&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exit script;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;end if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How could I do something similar using files? I have tried doing: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Name,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Age,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Sex&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;if ComputerName() = 'comp123' then&lt;/P&gt;&lt;P&gt;[\\......\test1\test.txt]&lt;/P&gt;&lt;P&gt;(txt, codepage is 1252, embedded labels, delimiter is ',', msq);&lt;/P&gt;&lt;P&gt;elseif &lt;/P&gt;&lt;P&gt;ComputerName() = 'comp324' then&lt;/P&gt;&lt;P&gt;[\\......\test4\test.txt]&lt;/P&gt;&lt;P&gt;(txt, codepage is 1252, embedded labels, delimiter is ',', msq);&lt;/P&gt;&lt;P&gt;end if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but that does not seem to work. Please let me know if there are other ways of doing this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Aug 2014 04:14:50 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-08-20T04:14:50Z</dc:date>
    <item>
      <title>Qlik: Loading from Flat Files based on environment</title>
      <link>https://community.qlik.com/t5/QlikView/Qlik-Loading-from-Flat-Files-based-on-environment/m-p/709920#M672694</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 have a requirement to load data from a flat file based on the environment the reload is happening in. Is there a way to achieve this? I was searching through the forum and found a few posts that talk about different connections based on environment / computer name:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the connection, the suggestion from @&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-weight: bold;"&gt;Ralf Becher &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;on another post &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;was to use something like this: &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;if ComputerName() = 'COMPUTER_A' then&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CONNECT DB1....;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;elseif ComputerName() = 'COMPUTER_B' then&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CONNECT DB2....;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;else&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exit script;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;end if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How could I do something similar using files? I have tried doing: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Name,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Age,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Sex&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;if ComputerName() = 'comp123' then&lt;/P&gt;&lt;P&gt;[\\......\test1\test.txt]&lt;/P&gt;&lt;P&gt;(txt, codepage is 1252, embedded labels, delimiter is ',', msq);&lt;/P&gt;&lt;P&gt;elseif &lt;/P&gt;&lt;P&gt;ComputerName() = 'comp324' then&lt;/P&gt;&lt;P&gt;[\\......\test4\test.txt]&lt;/P&gt;&lt;P&gt;(txt, codepage is 1252, embedded labels, delimiter is ',', msq);&lt;/P&gt;&lt;P&gt;end if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but that does not seem to work. Please let me know if there are other ways of doing this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2014 04:14:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlik-Loading-from-Flat-Files-based-on-environment/m-p/709920#M672694</guid>
      <dc:creator />
      <dc:date>2014-08-20T04:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik: Loading from Flat Files based on environment</title>
      <link>https://community.qlik.com/t5/QlikView/Qlik-Loading-from-Flat-Files-based-on-environment/m-p/709921#M672695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try writing the entire load script under the condition like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If conputername()='comp123' then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Load ...... From &amp;lt;Source1&amp;gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ElseIf conputername()='comp234' then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Load ...... From &amp;lt;Source2&amp;gt;;&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2014 08:01:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlik-Loading-from-Flat-Files-based-on-environment/m-p/709921#M672695</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2014-08-20T08:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik: Loading from Flat Files based on environment</title>
      <link>https://community.qlik.com/t5/QlikView/Qlik-Loading-from-Flat-Files-based-on-environment/m-p/709922#M672696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To avoid redundant code you could check and store the computer within a variable and use these variable as PathFile, example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let PathFile = pick(match(computername(), 'comp123', 'comp234'), '\\......\test1\test.txt', '\\......\test4\test.txt');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load * From $(PathFile) (txt, codepage is 1252, embedded labels, delimiter is ',', msq);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2014 10:13:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlik-Loading-from-Flat-Files-based-on-environment/m-p/709922#M672696</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2014-08-20T10:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik: Loading from Flat Files based on environment</title>
      <link>https://community.qlik.com/t5/QlikView/Qlik-Loading-from-Flat-Files-based-on-environment/m-p/709923#M672697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I use a config file, which is a qvs file containing the local environment settings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first line of my script points to that file (I have common folder achitecture across environments)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;$(Must_Include= mypath\QVConfig.qvs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could set a varible in this file, and use it as above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;Regards,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;Marty.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2014 10:21:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlik-Loading-from-Flat-Files-based-on-environment/m-p/709923#M672697</guid>
      <dc:creator>martynlloyd</dc:creator>
      <dc:date>2014-08-20T10:21:26Z</dc:date>
    </item>
  </channel>
</rss>

