<?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: File Loop with where field found or not found in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/File-Loop-with-where-field-found-or-not-found/m-p/2069188#M1223580</link>
    <description>&lt;P&gt;start with loading all data in a temp table... then use something like coalesce to fill in the blanks?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;tempAllData:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;load 1 as _justAfieldtocreateatable&lt;/P&gt;
&lt;P&gt;autogenerate(1);&amp;nbsp;&lt;/P&gt;
&lt;P&gt;concatenate(tempAllData)&lt;/P&gt;
&lt;P&gt;load * from [lib://SourceFolder/*.xls];&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FinalTable:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;load&amp;nbsp;&lt;/P&gt;
&lt;P&gt;coalesce(ProjectName,'whatever you want when project field is empty') as Project_Name_Final,&lt;/P&gt;
&lt;P&gt;*&lt;/P&gt;
&lt;P&gt;resident&amp;nbsp;tempAllData where ... ;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;drop table tempAllData;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 09 May 2023 12:52:18 GMT</pubDate>
    <dc:creator>mikaelsc</dc:creator>
    <dc:date>2023-05-09T12:52:18Z</dc:date>
    <item>
      <title>File Loop with where field found or not found</title>
      <link>https://community.qlik.com/t5/QlikView/File-Loop-with-where-field-found-or-not-found/m-p/2069176#M1223579</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;
&lt;P&gt;I have used a File loop function to load Daily data into Qliksense from Jan 1st 2023, Now we have a situation -&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From May 1st there has been a new field "Project Name" which is present only in the new files after 1st May and doesnt appear in the older files.&lt;/P&gt;
&lt;P&gt;Inorder to load data, i am trying the below script in load editor but getting error saying field not found.&lt;/P&gt;
&lt;P&gt;if(Date(Date#(subfield( subfield(Filename() , 'MPR_', -1 ), '.xlsx', 1) , 'DD_MM_YYYY'),'DD-MM-YYYY')&amp;gt;=date('05/01/2023','DD-MM-YYYY')," Project Name",'') as Project_Name,&lt;/P&gt;
&lt;P&gt;Could you please check and assist me what i am missing above?&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 12:36:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/File-Loop-with-where-field-found-or-not-found/m-p/2069176#M1223579</guid>
      <dc:creator>richard24best</dc:creator>
      <dc:date>2023-05-09T12:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: File Loop with where field found or not found</title>
      <link>https://community.qlik.com/t5/QlikView/File-Loop-with-where-field-found-or-not-found/m-p/2069188#M1223580</link>
      <description>&lt;P&gt;start with loading all data in a temp table... then use something like coalesce to fill in the blanks?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;tempAllData:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;load 1 as _justAfieldtocreateatable&lt;/P&gt;
&lt;P&gt;autogenerate(1);&amp;nbsp;&lt;/P&gt;
&lt;P&gt;concatenate(tempAllData)&lt;/P&gt;
&lt;P&gt;load * from [lib://SourceFolder/*.xls];&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FinalTable:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;load&amp;nbsp;&lt;/P&gt;
&lt;P&gt;coalesce(ProjectName,'whatever you want when project field is empty') as Project_Name_Final,&lt;/P&gt;
&lt;P&gt;*&lt;/P&gt;
&lt;P&gt;resident&amp;nbsp;tempAllData where ... ;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;drop table tempAllData;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 12:52:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/File-Loop-with-where-field-found-or-not-found/m-p/2069188#M1223580</guid>
      <dc:creator>mikaelsc</dc:creator>
      <dc:date>2023-05-09T12:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: File Loop with where field found or not found</title>
      <link>https://community.qlik.com/t5/QlikView/File-Loop-with-where-field-found-or-not-found/m-p/2069642#M1223588</link>
      <description>&lt;P&gt;It's not possible to query the exists of a field within a load-statement. Beside the suggestion from&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/49570"&gt;@mikaelsc&lt;/a&gt;&amp;nbsp;to concatenate all loads against a dummy-table and adjusting the results afterwards you may also check the field-names within a pre-load with something like: temp: first 1 load * from Source; or with a check on the filename() or filetime() which is often not difficult within a filelist-loop, for example:&lt;/P&gt;
&lt;P&gt;for each file in filelist()&lt;BR /&gt;&amp;nbsp; &amp;nbsp;let vField = &lt;SPAN&gt;if(Date(Date#(subfield( subfield('$(file)' , 'MPR_', -1 ), '.xlsx', 1) , 'DD_MM_YYYY'),'DD-MM- &lt;BR /&gt;&amp;nbsp; &amp;nbsp;YYYY')&amp;gt;=date('05/01/2023','DD-MM-YYYY'), 'Project Name', 'null() as Project Name');&lt;BR /&gt;&amp;nbsp; &amp;nbsp;t: load YourFields, $(vField) from Source;&lt;BR /&gt;next&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In all cases in which you not specifies the extra fields for all loads directly you will need a concatenation because otherwise the loads would create multiple tables caused from the differing&amp;nbsp;data-structure.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Another method would be not to load from ones from one folder else using for each data-structure an own one folder and applying several load-statements. It's not so silly as it may look like because it keeps the loads itself very simple and readable.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;All methods have their benefits and disadvantages ...&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 11:50:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/File-Loop-with-where-field-found-or-not-found/m-p/2069642#M1223588</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2023-05-10T11:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: File Loop with where field found or not found</title>
      <link>https://community.qlik.com/t5/QlikView/File-Loop-with-where-field-found-or-not-found/m-p/2070475#M1223603</link>
      <description>&lt;P&gt;I created a separate mapping file with key and new field. Did a left join with main table in QLiksense. It worked!!1&lt;/P&gt;
&lt;P&gt;Thank you all for your time and support.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Richard&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2023 06:31:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/File-Loop-with-where-field-found-or-not-found/m-p/2070475#M1223603</guid>
      <dc:creator>richard24best</dc:creator>
      <dc:date>2023-05-12T06:31:20Z</dc:date>
    </item>
  </channel>
</rss>

