<?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: Load xml file other than 0kb file in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Load-xml-file-other-than-0kb-file/m-p/612612#M226071</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tried this solution but for some reason it never worked for me. I would be very glad if u can post me the script.&lt;/P&gt;&lt;P&gt;I'm still rookie &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; so need ur help.. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Mar 2014 07:45:30 GMT</pubDate>
    <dc:creator>mjayachandran</dc:creator>
    <dc:date>2014-03-24T07:45:30Z</dc:date>
    <item>
      <title>Load xml file other than 0kb file</title>
      <link>https://community.qlik.com/t5/QlikView/Load-xml-file-other-than-0kb-file/m-p/612608#M226067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a bunch of xml files and some of them are 0kb files. I want QlikView to load only the once that are either more than 0kb size or atleast contains some data. Whenever I try to load all files i encounter an error as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;XML document must have a top level element.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt; On line number: 0. On column number: 0. System ID: file:///..TaskResults/TaskResult_*.xml.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;Files:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;Load&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks for you help in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2014 07:07:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-xml-file-other-than-0kb-file/m-p/612608#M226067</guid>
      <dc:creator>mjayachandran</dc:creator>
      <dc:date>2014-03-24T07:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: Load xml file other than 0kb file</title>
      <link>https://community.qlik.com/t5/QlikView/Load-xml-file-other-than-0kb-file/m-p/612609#M226068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why dont you put..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set errormode = 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Sushil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2014 07:11:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-xml-file-other-than-0kb-file/m-p/612609#M226068</guid>
      <dc:creator>sushil353</dc:creator>
      <dc:date>2014-03-24T07:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: Load xml file other than 0kb file</title>
      <link>https://community.qlik.com/t5/QlikView/Load-xml-file-other-than-0kb-file/m-p/612610#M226069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can easily check the file size before load:&lt;/P&gt;&lt;P&gt;if filesize(filename) &amp;gt; 0 then&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;end if&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2014 07:20:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-xml-file-other-than-0kb-file/m-p/612610#M226069</guid>
      <dc:creator>whiteline</dc:creator>
      <dc:date>2014-03-24T07:20:02Z</dc:date>
    </item>
    <item>
      <title>Re: Load xml file other than 0kb file</title>
      <link>https://community.qlik.com/t5/QlikView/Load-xml-file-other-than-0kb-file/m-p/612611#M226070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;set errormode = 0;&lt;/P&gt;&lt;P&gt;will work,however the problem is it will ignore all the errors. I might never know if there is any-other issue. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2014 07:41:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-xml-file-other-than-0kb-file/m-p/612611#M226070</guid>
      <dc:creator>mjayachandran</dc:creator>
      <dc:date>2014-03-24T07:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: Load xml file other than 0kb file</title>
      <link>https://community.qlik.com/t5/QlikView/Load-xml-file-other-than-0kb-file/m-p/612612#M226071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tried this solution but for some reason it never worked for me. I would be very glad if u can post me the script.&lt;/P&gt;&lt;P&gt;I'm still rookie &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; so need ur help.. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2014 07:45:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-xml-file-other-than-0kb-file/m-p/612612#M226071</guid>
      <dc:creator>mjayachandran</dc:creator>
      <dc:date>2014-03-24T07:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: Load xml file other than 0kb file</title>
      <link>https://community.qlik.com/t5/QlikView/Load-xml-file-other-than-0kb-file/m-p/612613#M226072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For each vFileName in Filelist ('FilePath\*.xls')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; load * where Size &amp;gt; 24;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Load *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '$(vFileName)' as FileName,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SubField( SubField( '$(vFileName)','\',-1),'.',1) as FileType,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Floor( FileSize('$(vFileName)')/1024) AS Size&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; From [$(vFileName)];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Next vFileName&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2014 07:49:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-xml-file-other-than-0kb-file/m-p/612613#M226072</guid>
      <dc:creator>nizamsha</dc:creator>
      <dc:date>2014-03-24T07:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: Load xml file other than 0kb file</title>
      <link>https://community.qlik.com/t5/QlikView/Load-xml-file-other-than-0kb-file/m-p/612614#M226073</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;It seems that you load the files using wildcard.&lt;/P&gt;&lt;P&gt;But to check the file size for each file before load you have to write the loop explicitly.&lt;/P&gt;&lt;P&gt;The easiest way is to use foreach + filelist as described in help and add the condition:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for each FileName in filelist('TaskResults/TaskResult_*.xml')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if filesize('$(FileName)')&amp;gt;0 then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from [$(FileName)] ...;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end if&lt;/P&gt;&lt;P&gt;next FileName;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2014 19:29:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-xml-file-other-than-0kb-file/m-p/612614#M226073</guid>
      <dc:creator>whiteline</dc:creator>
      <dc:date>2014-03-24T19:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: Load xml file other than 0kb file</title>
      <link>https://community.qlik.com/t5/QlikView/Load-xml-file-other-than-0kb-file/m-p/612615#M226074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I found a solution :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is only while reading 0kb/ Corrupt XML file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can you something like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set ErrorMode=0;&lt;/P&gt;&lt;P&gt;{ Then your Load statement }&lt;/P&gt;&lt;P&gt;if&amp;nbsp; (ScriptError = 1) then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; exit script;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end if&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set errormode=1;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2014 07:25:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-xml-file-other-than-0kb-file/m-p/612615#M226074</guid>
      <dc:creator>mjayachandran</dc:creator>
      <dc:date>2014-08-20T07:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: Load xml file other than 0kb file</title>
      <link>https://community.qlik.com/t5/QlikView/Load-xml-file-other-than-0kb-file/m-p/612616#M226075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a question with this.&amp;nbsp; Do you set up this piece of code after every load statement in your tab?&lt;/P&gt;&lt;P&gt;set errormode=0; - at the top of your tab&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after each load statement - add&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;if&amp;nbsp; (ScriptError = 1) then&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; exit script;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end if&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set errormode=1;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I'm trying to understand the process and just making sure I am setting this up correct.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Aug 2015 14:36:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-xml-file-other-than-0kb-file/m-p/612616#M226075</guid>
      <dc:creator>ngosz4074</dc:creator>
      <dc:date>2015-08-18T14:36:51Z</dc:date>
    </item>
  </channel>
</rss>

