<?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 Load Script If File Exists in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Load-Script-If-File-Exists/m-p/1594606#M43750</link>
    <description>&lt;P&gt;i have 20 load scripts and after each load table I generate one text file. So If every load script runs properly 20 files will be created.&lt;/P&gt;&lt;P&gt;Now what i want is to implement a solution where from the next time onwards those load scripts will only run if corresponding text file is present in the file path. Please help how to code the same?&lt;/P&gt;&lt;P&gt;Like below:&lt;/P&gt;&lt;P&gt;if( text file1 exist in file path) THEN&lt;/P&gt;&lt;P&gt;LOAD Table 1&lt;/P&gt;&lt;P&gt;END IF&lt;/P&gt;&lt;P&gt;if (text file 2 exist in file path) THEN&lt;/P&gt;&lt;P&gt;LOAD Table 2&lt;/P&gt;&lt;P&gt;END IF&lt;/P&gt;&lt;P&gt;if(text file 3 exist in file path) THEN&lt;/P&gt;&lt;P&gt;LOAD Table 3&lt;/P&gt;&lt;P&gt;END IF&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;if(text file 20 exist in file path) THEN&lt;/P&gt;&lt;P&gt;LOAD Table 20&lt;/P&gt;&lt;P&gt;END IF&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 21 Jun 2019 12:43:45 GMT</pubDate>
    <dc:creator>Ron1</dc:creator>
    <dc:date>2019-06-21T12:43:45Z</dc:date>
    <item>
      <title>Load Script If File Exists</title>
      <link>https://community.qlik.com/t5/App-Development/Load-Script-If-File-Exists/m-p/1594606#M43750</link>
      <description>&lt;P&gt;i have 20 load scripts and after each load table I generate one text file. So If every load script runs properly 20 files will be created.&lt;/P&gt;&lt;P&gt;Now what i want is to implement a solution where from the next time onwards those load scripts will only run if corresponding text file is present in the file path. Please help how to code the same?&lt;/P&gt;&lt;P&gt;Like below:&lt;/P&gt;&lt;P&gt;if( text file1 exist in file path) THEN&lt;/P&gt;&lt;P&gt;LOAD Table 1&lt;/P&gt;&lt;P&gt;END IF&lt;/P&gt;&lt;P&gt;if (text file 2 exist in file path) THEN&lt;/P&gt;&lt;P&gt;LOAD Table 2&lt;/P&gt;&lt;P&gt;END IF&lt;/P&gt;&lt;P&gt;if(text file 3 exist in file path) THEN&lt;/P&gt;&lt;P&gt;LOAD Table 3&lt;/P&gt;&lt;P&gt;END IF&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;if(text file 20 exist in file path) THEN&lt;/P&gt;&lt;P&gt;LOAD Table 20&lt;/P&gt;&lt;P&gt;END IF&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 12:43:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Load-Script-If-File-Exists/m-p/1594606#M43750</guid>
      <dc:creator>Ron1</dc:creator>
      <dc:date>2019-06-21T12:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: Load Script If File Exists</title>
      <link>https://community.qlik.com/t5/App-Development/Load-Script-If-File-Exists/m-p/1594651#M43752</link>
      <description>&lt;P&gt;You could do something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;set dir = C:\Projetos\Qlik\1.Apps\1.Extract_Transform_Automatization;&lt;/P&gt;&lt;P&gt;if (FileSize('$(dir)\a.txt')&amp;gt;0) then&lt;BR /&gt;[a]:&lt;BR /&gt;LOAD @1&lt;BR /&gt;FROM&lt;BR /&gt;[C:\Projetos\Qlik\1.Apps\1.Extract_Transform_Automatization\a.txt]&lt;BR /&gt;(txt, utf8, no labels, delimiter is '\t', msq);&lt;BR /&gt;endif;&lt;/P&gt;&lt;P&gt;That will only load if the file exists and has a size greater than 0kb.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just repeat the same code for the others and you'll have roughly what you need.&lt;/P&gt;&lt;P&gt;I'd take another approach, but it'd require&amp;nbsp;the&amp;nbsp;DoDir() function from QDF (&lt;A href="https://github.com/QlikDeploymentFramework/Qlik-Deployment-Framework" target="_blank"&gt;https://github.com/QlikDeploymentFramework/Qlik-Deployment-Framework&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;to check which file exists or not.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 14:02:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Load-Script-If-File-Exists/m-p/1594651#M43752</guid>
      <dc:creator>felipedl</dc:creator>
      <dc:date>2019-06-21T14:02:14Z</dc:date>
    </item>
  </channel>
</rss>

