<?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: Create date field using file names in incremental load in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Create-date-field-using-file-names-in-incremental-load/m-p/1363064#M618235</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Got it! The problem is on the file name. The trace function is so useful to save time on debugging.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thank you so much for helping me identify the problem. &lt;SPAN style="font-size: 13.3333px;"&gt;Massimo &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Apr 2017 16:01:03 GMT</pubDate>
    <dc:creator />
    <dc:date>2017-04-11T16:01:03Z</dc:date>
    <item>
      <title>Create date field using file names in incremental load</title>
      <link>https://community.qlik.com/t5/QlikView/Create-date-field-using-file-names-in-incremental-load/m-p/1363062#M618233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Qlikview Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;Objective:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I'm trying to use this code to load several excel files in the same folder. I only need 2 values from each excel. and then create the date fields from the file names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are my files in the folder:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="159493" alt="Fields.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/159493_Fields.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="; color: #ff0000;"&gt;&lt;STRONG&gt;Below is my code:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Let Path_Hospira='---\\Auto Programming\Hospira for Peds\Hospira*.xlsx';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For each file in FileList(Path_Hospira)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let Year = Right('$(File)',4);&lt;/P&gt;&lt;P&gt;Let Month = Mid('$(File)',9,3);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hospira_raw:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; F11 as AUTOPROGRAMMED,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; F33 as FIN,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'CHILD' as FACILITY,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '$(Year)' as year,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '$(Month)' as Month,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '$(Year)' &amp;amp; Num('$(Month)','00') as YearMonth&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;$(file)&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is [Page 1]) where RecNo() = 25;&lt;/P&gt;&lt;P&gt;NEXT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Store Hospira_raw into \\Auto programming\QVDs\Hospira_raw.qvd (qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="; color: #ff0000;"&gt;&lt;STRONG&gt;Problem:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The problem is that my date fields don't return the value. See below:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="159497" alt="tables.PNG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/159497_tables.PNG" style="height: 88px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you help with the problem? Please let me know if you have any question.&lt;/P&gt;&lt;P&gt;I attached the raw data and my QVW here for you to play with.&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Apr 2017 18:26:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-date-field-using-file-names-in-incremental-load/m-p/1363062#M618233</guid>
      <dc:creator />
      <dc:date>2017-04-07T18:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: Create date field using file names in incremental load</title>
      <link>https://community.qlik.com/t5/QlikView/Create-date-field-using-file-names-in-incremental-load/m-p/1363063#M618234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;maybe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Let Path_Hospira='yourpathhere\Hospira*.xlsx';&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;For each file in FileList('$(Path_Hospira)')&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; trace $(file); &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; // file name without suffix&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; &lt;/EM&gt;&lt;EM style="font-size: 10pt;"&gt;LET f = replace(subfield('$(file)', '\', -1), '.xlsx', '');&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; trace $(f);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; // year, month, month num&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; LET Year = Right('$(f)', 4);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; LET Month = (Mid('$(f)', 9, 3));&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; // your MonthNames var should match the Month var&amp;nbsp; &lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; LET MonthNum = Num(Div(Index(Lower('$(MonthNames)'), Lower('$(Month)')),4)+1, '00');&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; trace $(Year); &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; trace $(Month) - $(MonthNum);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; Hospira_raw:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; LOAD&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...............&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;NEXT&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Apr 2017 19:30:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-date-field-using-file-names-in-incremental-load/m-p/1363063#M618234</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2017-04-07T19:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: Create date field using file names in incremental load</title>
      <link>https://community.qlik.com/t5/QlikView/Create-date-field-using-file-names-in-incremental-load/m-p/1363064#M618235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Got it! The problem is on the file name. The trace function is so useful to save time on debugging.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thank you so much for helping me identify the problem. &lt;SPAN style="font-size: 13.3333px;"&gt;Massimo &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Apr 2017 16:01:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-date-field-using-file-names-in-incremental-load/m-p/1363064#M618235</guid>
      <dc:creator />
      <dc:date>2017-04-11T16:01:03Z</dc:date>
    </item>
  </channel>
</rss>

