<?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 file structure (e.g. txt-file) before loading data in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Check-file-structure-e-g-txt-file-before-loading-data/m-p/1379978#M420817</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply but how you would do this? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because setting errormode = 0 then i get no error message but normaly I want all messages.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Dec 2017 15:11:27 GMT</pubDate>
    <dc:creator>phil-ebm</dc:creator>
    <dc:date>2017-12-11T15:11:27Z</dc:date>
    <item>
      <title>Check file structure (e.g. txt-file) before loading data</title>
      <link>https://community.qlik.com/t5/QlikView/Check-file-structure-e-g-txt-file-before-loading-data/m-p/1379976#M420815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Community&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I searching a lot but couldn't find a solution for my problem. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my case i have a folder where all measure files from our products are saved as a txt-file. With qlikview I want to load all the files into a datamodel so we can work with this data. &lt;/P&gt;&lt;P&gt;No my problem is that some of these files are corrupt or not complete and I don't want to load this data into my model. A File is corrupt for example when not all columns are available. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I just load the data into my model then I get an error when I arrive at a corrupt file and the load stops. &lt;/P&gt;&lt;P&gt;Now my plan is to check if the number of available columns in the txt-file is equal to the need columns and then i will load the data. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have someone expriences here how I can do that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Dec 2017 14:25:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Check-file-structure-e-g-txt-file-before-loading-data/m-p/1379976#M420815</guid>
      <dc:creator>phil-ebm</dc:creator>
      <dc:date>2017-12-11T14:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: Check file structure (e.g. txt-file) before loading data</title>
      <link>https://community.qlik.com/t5/QlikView/Check-file-structure-e-g-txt-file-before-loading-data/m-p/1379977#M420816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use error handling to skip the files that produce errors.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Dec 2017 15:01:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Check-file-structure-e-g-txt-file-before-loading-data/m-p/1379977#M420816</guid>
      <dc:creator>m_woolf</dc:creator>
      <dc:date>2017-12-11T15:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: Check file structure (e.g. txt-file) before loading data</title>
      <link>https://community.qlik.com/t5/QlikView/Check-file-structure-e-g-txt-file-before-loading-data/m-p/1379978#M420817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply but how you would do this? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because setting errormode = 0 then i get no error message but normaly I want all messages.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Dec 2017 15:11:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Check-file-structure-e-g-txt-file-before-loading-data/m-p/1379978#M420817</guid>
      <dc:creator>phil-ebm</dc:creator>
      <dc:date>2017-12-11T15:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: Check file structure (e.g. txt-file) before loading data</title>
      <link>https://community.qlik.com/t5/QlikView/Check-file-structure-e-g-txt-file-before-loading-data/m-p/1379979#M420818</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Error handling means normally more than just setting the erromode to 0 and ignoring all errors else to enable the errormode and disable it afterwards probably multiple times during the script - and also querying the error-status after the statements and re-acting on the results, for example no error happens just go on, an uncritical error occured just trace this error within the log-file or maybe a critical error happens and you want to exit the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This could be quite expensive but sometimes there is no alternatively for such an approach. But in your case you could avoid it if you read the table-structure and comparing it against the target-structure before you made the real load. Maybe with something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check:&lt;/P&gt;&lt;P&gt;first 1 load * from Source;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fields:&lt;/P&gt;&lt;P&gt;load fieldname(recno(), 'Check') as Fields autogenerate nooffields('Check');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This table could be compared against your target maybe with some joining/mapping or aggregating it to fieldlist-string. There are various ways possible. After them you could know if the file is valid or not and you could just skip it without using the error-mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Dec 2017 15:40:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Check-file-structure-e-g-txt-file-before-loading-data/m-p/1379979#M420818</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2017-12-11T15:40:51Z</dc:date>
    </item>
  </channel>
</rss>

