<?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: Check for file in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Check-for-file-in-script/m-p/1185483#M629252</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your variables contain string-values and therefore you need to add single-quotes around them like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;filetime('$(var_datasourcespath1)''$(var_datasourcefile)')&lt;/SPAN&gt;&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, 28 Sep 2016 11:19:01 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2016-09-28T11:19:01Z</dc:date>
    <item>
      <title>Check for file in script</title>
      <link>https://community.qlik.com/t5/QlikView/Check-for-file-in-script/m-p/1185478#M629247</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;Currently I'm loading my file with an wildcard and variables, looking like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET var_datasourcefile='BC*.xml';&lt;/P&gt;&lt;P&gt;trace $(var_datasourcespath1)$(var_datasourcefile);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD *&lt;/P&gt;&lt;P&gt;FROM &lt;SPAN style="font-size: 13.3333px;"&gt;$(var_datasourcespath1)$(var_datasourcefile);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that is working out great, but now I want to check if the xml file exists in the map, and if it doesnt exist, it should skip the script. &lt;/P&gt;&lt;P&gt;I thought it could be done like this:&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;SET var_datasourcefile='BC*.xml';&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;IF filetime($(var_datasourcespath1)$(var_datasourcefile))&amp;gt;0 then&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;LOAD *&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;FROM &lt;SPAN style="font-size: 13.3333px;"&gt;$(var_datasourcespath1)$(var_datasourcefile);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;ENDIF&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;However, this doesn't seem to work, can anyone help me with this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Thanks a lot!&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Best regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Dick&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2016 10:35:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Check-for-file-in-script/m-p/1185478#M629247</guid>
      <dc:creator>dickelsa</dc:creator>
      <dc:date>2016-09-28T10:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: Check for file in script</title>
      <link>https://community.qlik.com/t5/QlikView/Check-for-file-in-script/m-p/1185479#M629248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try to use IF , ELSE Condition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SET var_datasourcefile='BC*.xml';&lt;/P&gt;&lt;P style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;IF filetime($(var_datasourcespath1)$(var_datasourcefile))&amp;gt;0 then&lt;/P&gt;&lt;P style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD *&lt;/P&gt;&lt;P style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FROM &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;$(var_datasourcespath1)$(var_datasourcefile);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;&lt;STRONG&gt;ELSE IF&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;&lt;STRONG&gt;TRACE &amp;lt;&amp;lt;&amp;lt;Not Found&amp;gt;&amp;gt;&amp;gt;&amp;gt;;&lt;/STRONG&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;ENDIF&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2016 10:54:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Check-for-file-in-script/m-p/1185479#M629248</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2016-09-28T10:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: Check for file in script</title>
      <link>https://community.qlik.com/t5/QlikView/Check-for-file-in-script/m-p/1185480#M629249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;An alternatively to a check if a file exists you could use a load per filelist: &lt;A href="https://community.qlik.com/docs/DOC-14663"&gt;Dynamically Loading Multiple Excel Files&lt;/A&gt;.&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, 28 Sep 2016 10:58:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Check-for-file-in-script/m-p/1185480#M629249</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-09-28T10:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: Check for file in script</title>
      <link>https://community.qlik.com/t5/QlikView/Check-for-file-in-script/m-p/1185481#M629250</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;This still doesn't work, sorry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Dick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2016 11:13:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Check-for-file-in-script/m-p/1185481#M629250</guid>
      <dc:creator>dickelsa</dc:creator>
      <dc:date>2016-09-28T11:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: Check for file in script</title>
      <link>https://community.qlik.com/t5/QlikView/Check-for-file-in-script/m-p/1185482#M629251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it just sais:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;script line error:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;IF filetime($(var_datasourcespath1)$(var_datasourcefile))&amp;gt;0 then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;and then it starts executing the rest of the script.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2016 11:14:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Check-for-file-in-script/m-p/1185482#M629251</guid>
      <dc:creator>dickelsa</dc:creator>
      <dc:date>2016-09-28T11:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: Check for file in script</title>
      <link>https://community.qlik.com/t5/QlikView/Check-for-file-in-script/m-p/1185483#M629252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your variables contain string-values and therefore you need to add single-quotes around them like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;filetime('$(var_datasourcespath1)''$(var_datasourcefile)')&lt;/SPAN&gt;&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, 28 Sep 2016 11:19:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Check-for-file-in-script/m-p/1185483#M629252</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-09-28T11:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: Check for file in script</title>
      <link>https://community.qlik.com/t5/QlikView/Check-for-file-in-script/m-p/1185484#M629253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is working in my case:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="font-size: 12pt;"&gt;if&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt; &lt;SPAN style="color: #0000ff;"&gt;filetime&lt;/SPAN&gt;('$(var_datasourcespath1)$(var_datasourcefile)') &amp;gt; 0 &lt;SPAN style="color: #0000ff;"&gt;then &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2016 13:50:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Check-for-file-in-script/m-p/1185484#M629253</guid>
      <dc:creator />
      <dc:date>2016-09-28T13:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: Check for file in script</title>
      <link>https://community.qlik.com/t5/QlikView/Check-for-file-in-script/m-p/1185485#M629254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would use a &lt;STRONG&gt;for..each&lt;/STRONG&gt; loop combined with the &lt;STRONG&gt;filelist()&lt;/STRONG&gt; function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://qlikviewmaven.blogspot.co.uk/2008/09/loading-all-of-files-from-folder.html" title="http://qlikviewmaven.blogspot.co.uk/2008/09/loading-all-of-files-from-folder.html"&gt;QlikView Maven: Loading All of the Files from a Folder&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2016 13:56:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Check-for-file-in-script/m-p/1185485#M629254</guid>
      <dc:creator>Colin-Albert</dc:creator>
      <dc:date>2016-09-28T13:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: Check for file in script</title>
      <link>https://community.qlik.com/t5/QlikView/Check-for-file-in-script/m-p/1185486#M629255</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;Considering my script, it is not possible to just 'loop through it'&lt;/P&gt;&lt;P&gt;i found the solution to the problem. As it turns out, for FileTime() you need the complete directory of the file, and not the relative path (my variables did only have the relative).&lt;/P&gt;&lt;P&gt;However, since i want my files to work no matter which pc or location I use, without editing the script I built a DIY relative path using the system function DocumentPath()&lt;/P&gt;&lt;P&gt;now it looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET var_datasourcespath= 'Data\Sources\';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let var_thispath= DocumentPath();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let var_documenttitle= 'FileName.qvw';&lt;/P&gt;&lt;P&gt;trace $(var_documenttitle);&lt;/P&gt;&lt;P&gt;let var_thispath= Replace('$(var_thispath)','$(var_documenttitle)','');&lt;/P&gt;&lt;P&gt;trace $(var_thispath);&lt;/P&gt;&lt;P&gt;let var_datasourcespath= '$(var_thispath)$(var_datasourcespath)';&lt;/P&gt;&lt;P&gt;trace $(var_datasourcespath);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET var_datasourcefile='BC*.xml';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET var_FileName =&amp;nbsp; '$(var_datasourcespath)$(var_datasourcefile)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRACE 'Filename= $(var_FileName)';&lt;/P&gt;&lt;P&gt;IF FileTIme('$(var_FileName)')&amp;gt;0 THEN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD *&lt;/P&gt;&lt;P&gt;FROM &lt;SPAN style="font-size: 13.3333px;"&gt; '$(var_datasourcespath)$(var_datasourcefile)';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;ENDIF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works like a charm now, so that is great!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Dick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2016 19:29:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Check-for-file-in-script/m-p/1185486#M629255</guid>
      <dc:creator>dickelsa</dc:creator>
      <dc:date>2016-09-28T19:29:07Z</dc:date>
    </item>
  </channel>
</rss>

