<?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: Include Statement with a variable relative path in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Include-Statement-with-a-variable-relative-path/m-p/372223#M138403</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Problem solved - the absolute path contained a folder with a space, and it looks like the include-statement can't deal with spaces and just sulks and refuses to work &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/wink.png" /&gt; &lt;/P&gt;&lt;P&gt;With a space-less path, Jonathan's syntax works just fine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Jun 2014 10:49:13 GMT</pubDate>
    <dc:creator>lenka_kruse</dc:creator>
    <dc:date>2014-06-11T10:49:13Z</dc:date>
    <item>
      <title>Include Statement with a variable relative path</title>
      <link>https://community.qlik.com/t5/QlikView/Include-Statement-with-a-variable-relative-path/m-p/372218#M138398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm looking to manager a large number of qvw files across multiple platforms.&amp;nbsp; In an attempt to centralize and ease maintence, change requests and version control, I'm converting my scripts into .txt files and referencing them as $(include) statements in my scripts.&amp;nbsp; I'm using relative paths.&amp;nbsp; However, the path of where these files may reside could very well change too so I'm looking to make the relative path a variable as well.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I make my $(Include) statement include another $(variable) that contains a path?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Normal include:&lt;/P&gt;&lt;P&gt;$(Include=..\..\loader scripts\loader_dim_location.txt);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I want something like this:&lt;/P&gt;&lt;P&gt;Let $(LoaderPath) = '..\..\loader scripts\';&lt;/P&gt;&lt;P&gt;Let $(DynamicInclude) = '$(Include=' &amp;amp; $(LoaderPath) &amp;amp; 'loader_dim_location.txt)';&lt;/P&gt;&lt;P&gt;$(DynamicInclude);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This doesn't error, it just doesn't work.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2012 15:16:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Include-Statement-with-a-variable-relative-path/m-p/372218#M138398</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-03-27T15:16:35Z</dc:date>
    </item>
    <item>
      <title>Include Statement with a variable relative path</title>
      <link>https://community.qlik.com/t5/QlikView/Include-Statement-with-a-variable-relative-path/m-p/372219#M138399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try not using $ while assgining a variable. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let LoaderPath = '..\..\loader scripts\';&lt;/P&gt;&lt;P&gt;is the correct usage&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use $ whenever you want to substitue variable with the value it is holding&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2012 15:32:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Include-Statement-with-a-variable-relative-path/m-p/372219#M138399</guid>
      <dc:creator />
      <dc:date>2012-03-27T15:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: Include Statement with a variable relative path</title>
      <link>https://community.qlik.com/t5/QlikView/Include-Statement-with-a-variable-relative-path/m-p/372220#M138400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In case anyone has similar problems, under SR11 I seem to need to use the following lines (ClientDefDir is what was called LoaderPath in the example above):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET DynamicInclude = '(Include=$(ClientDefDir)\script_client_language.qvs)';&lt;/P&gt;&lt;P&gt;$$(DynamicInclude);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure why I had to do this double dollar expansion on the include line.&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2013 09:38:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Include-Statement-with-a-variable-relative-path/m-p/372220#M138400</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-01-02T09:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: Include Statement with a variable relative path</title>
      <link>https://community.qlik.com/t5/QlikView/Include-Statement-with-a-variable-relative-path/m-p/372221#M138401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Update to this. Seems you don't even have to do the initial variable declaration as the following works fine:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(Include=$(ClientDefDir)\script_client_language.qvs);&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2013 09:53:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Include-Statement-with-a-variable-relative-path/m-p/372221#M138401</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-01-02T09:53:43Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Include Statement with a variable relative path</title>
      <link>https://community.qlik.com/t5/QlikView/Include-Statement-with-a-variable-relative-path/m-p/372222#M138402</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'm using the latest QV-Version (11.20.12354.0409, x64) and I still have the problem that the include-statement doesn't work if I include a path-variable.&lt;/P&gt;&lt;P&gt;I use centrally defined absolute paths:&lt;/P&gt;&lt;P&gt;// Root-Folder&lt;/P&gt;&lt;P&gt;set vP_Root = &lt;A href="https://community.qlik.com/"&gt;\\qvap\blabla\Source_Docs\&lt;/A&gt;;&lt;/P&gt;&lt;P&gt;// System-Folder&lt;/P&gt;&lt;P&gt;let vP_01_Meta = '$(vP_Root)01_Metadaten';&lt;/P&gt;&lt;P&gt;let vP_02_Include = '$(vP_Root)02_Include';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want the include-statement to use the pre-defined path that points to the 02_Include-folder:&lt;/P&gt;&lt;P&gt;$(Include= $(vP_02_Include)\skript_metadaten.txt);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With that syntax, however, it doesn't work. No error-message, just no inclusion of the script-file. In Debug-Mode, it just shows the content of the vP_Root- and vP_02_Include-variables in the script-position where the include-file should be shown.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anybody have a clue what I'm doing wrong in the syntax?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2014 09:57:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Include-Statement-with-a-variable-relative-path/m-p/372222#M138402</guid>
      <dc:creator>lenka_kruse</dc:creator>
      <dc:date>2014-06-11T09:57:01Z</dc:date>
    </item>
    <item>
      <title>Re: Include Statement with a variable relative path</title>
      <link>https://community.qlik.com/t5/QlikView/Include-Statement-with-a-variable-relative-path/m-p/372223#M138403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Problem solved - the absolute path contained a folder with a space, and it looks like the include-statement can't deal with spaces and just sulks and refuses to work &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/wink.png" /&gt; &lt;/P&gt;&lt;P&gt;With a space-less path, Jonathan's syntax works just fine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2014 10:49:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Include-Statement-with-a-variable-relative-path/m-p/372223#M138403</guid>
      <dc:creator>lenka_kruse</dc:creator>
      <dc:date>2014-06-11T10:49:13Z</dc:date>
    </item>
    <item>
      <title>Re: Include Statement with a variable relative path</title>
      <link>https://community.qlik.com/t5/QlikView/Include-Statement-with-a-variable-relative-path/m-p/372224#M138404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can i pass multiple paths in this scenario? I want to pass multiple path locations in QVS path of system monitor application&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2015 09:29:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Include-Statement-with-a-variable-relative-path/m-p/372224#M138404</guid>
      <dc:creator>rsdhavle</dc:creator>
      <dc:date>2015-05-29T09:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: Include Statement with a variable relative path</title>
      <link>https://community.qlik.com/t5/QlikView/Include-Statement-with-a-variable-relative-path/m-p/1554045#M440515</link>
      <description>&lt;P&gt;I know this is an old post but i solved it like this.&lt;BR /&gt;It's a newbie way but works flawlessly.&lt;/P&gt;&lt;PRE&gt;LET vOSuser = subfield(OSuser(), '\', -1);
LET vPath = 'C:\users\$(vOSuser)\Desktop\';

Txt_Docs:
Load * inline [
NrOfDoc, DocName
1, 1.Demo_data.qvs
2, 2.Calendar.qvs
3, 3.Measures_and_Variables.qvs
]
;
//4, 4.Call_subs.qvs

ERRORMODE=0;
LET NumRows=NoOfRows('Txt_Docs');

 FOR i=1 to $(NumRows);
 LET vDocName = Peek('DocName', $(i)-1, 'Txt_Docs');
 LET vDocument = '$(vPath)' &amp;amp; '$(vDocName)';
 LET vDollarSymbol = chr(36);
 LET vDynamicInclude = '$(vDollarSymbol)' &amp;amp; '(Include=' &amp;amp; '$(vDocument)' &amp;amp; ');';
 
 trace $(vDynamicInclude);
 $(vDynamicInclude);

next&lt;BR /&gt;&lt;BR /&gt;$(Include=C:\users\$(vOSuser)\Desktop\4.Call_subs.qvs);

ERRORMODE=1;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Mar 2019 09:32:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Include-Statement-with-a-variable-relative-path/m-p/1554045#M440515</guid>
      <dc:creator>Kalmer</dc:creator>
      <dc:date>2019-03-08T09:32:30Z</dc:date>
    </item>
  </channel>
</rss>

