<?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: Error in loading in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Error-in-loading/m-p/1746786#M721072</link>
    <description>&lt;P&gt;Hello Mr.&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28038"&gt;@marcus_sommer&lt;/a&gt; . It is loading perfectly, but the issue is with the variable MONTH&amp;nbsp; (as you can see in this script)&amp;nbsp;&lt;/P&gt;&lt;P&gt;let&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;vFilePath&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;= FieldValue('Path',$(i));&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;&lt;STRONG&gt;let&amp;nbsp;vMonth&amp;nbsp;= FieldValue('Month',$(i));&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Concatenate(Data)&lt;BR /&gt;LOAD *,&lt;BR /&gt;FileBaseName() as&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;FileName,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;&lt;STRONG&gt;'$(vMonth)' as MONTH&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;It gives that 08 August is bigger than 11 September&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 24 Sep 2020 11:51:42 GMT</pubDate>
    <dc:creator>KaisGarci</dc:creator>
    <dc:date>2020-09-24T11:51:42Z</dc:date>
    <item>
      <title>Error in loading</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-loading/m-p/1746606#M721051</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello everyone,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is my script:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for Each vFile in FileList(&lt;STRONG&gt;'C:\REAL_*.xlsx'&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;Files:&lt;BR /&gt;LOAD subfield('$(vFile)','\',-1) as FileName,&lt;BR /&gt;date(date#(mid('$(vFile)',index('$(vFile)','_',-1)+1,4),'DDMM')) as Month,&lt;BR /&gt;'$(vFile)' as Path&lt;BR /&gt;AutoGenerate 1;&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;P&gt;Files_needed:&lt;BR /&gt;NoConcatenate&lt;BR /&gt;first 2 LOAD *&lt;BR /&gt;Resident Files&lt;BR /&gt;Order by Month desc;&lt;/P&gt;&lt;P&gt;DROP Table Files;&lt;/P&gt;&lt;P&gt;Data:&lt;BR /&gt;LOAD * Inline [&lt;BR /&gt;Temp ];&lt;/P&gt;&lt;P&gt;for i=1 to FieldValueCount('Month')&lt;/P&gt;&lt;P&gt;let &lt;STRONG&gt;vFilePath&lt;/STRONG&gt; = FieldValue('Path',$(i));&lt;/P&gt;&lt;P&gt;Concatenate(Data)&lt;BR /&gt;LOAD *,&lt;BR /&gt;FileBaseName() as &lt;STRONG&gt;FileName&lt;/STRONG&gt;&lt;BR /&gt;FROM&lt;BR /&gt;&lt;EM&gt;[$(vFilePath)]&lt;/EM&gt;&lt;BR /&gt;&lt;STRONG&gt;(ooxml, embedded labels, table is Sheet1)&lt;/STRONG&gt;; // you can change this highlighted part as you may have different way of loading the excel files&lt;/P&gt;&lt;P&gt;NEXT&lt;/P&gt;&lt;P&gt;DROP Table Files_needed;&lt;/P&gt;&lt;P&gt;DROP Field Temp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;It is supposed to load the two latest files, I have files named Real_DDMMYYYY. But it is considering that the file Real_31082020 is latest that Real_11092020 which is not true.&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you please help me with that, I have a deadline in two days.&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-loading/m-p/1746606#M721051</guid>
      <dc:creator>KaisGarci</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Error in loading</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-loading/m-p/1746661#M721055</link>
      <description>&lt;P&gt;Hi, I think you should change&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;date(date#(mid('$(vFile)',index('$(vFile)','_',-1)+1,4),'DDMM')) as Month&lt;/LI-CODE&gt;&lt;P&gt;to&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;date(date#(mid('_31082020',index('_31082020','_',-1)+1,8),'DDMMYYYY')) as FileDate&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;And use FileDate instead of Month in the next script sentences, it you only use Month you will get an isue when january-2021 comes.&lt;/P&gt;&lt;P&gt;But still I don't know why it sets august higher than september in your code.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 07:05:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-loading/m-p/1746661#M721055</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2020-09-24T07:05:14Z</dc:date>
    </item>
    <item>
      <title>Re: Error in loading</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-loading/m-p/1746668#M721060</link>
      <description>&lt;P&gt;Thanks for your help Mr&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/22593"&gt;@rubenmarin&lt;/a&gt;. But I want it to load automatically the two latest file. In your example, it will not do that.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 07:15:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-loading/m-p/1746668#M721060</guid>
      <dc:creator>KaisGarci</dc:creator>
      <dc:date>2020-09-24T07:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: Error in loading</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-loading/m-p/1746731#M721065</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/123940"&gt;@KaisGarci&lt;/a&gt;&amp;nbsp; try below&lt;/P&gt;&lt;P&gt;for Each vFile in FileList('C:\REAL_*.xlsx')&lt;/P&gt;&lt;P&gt;Files:&lt;BR /&gt;LOAD subfield('$(vFile)','\',-1) as FileName,&lt;BR /&gt;&lt;STRONG&gt;date(date#(trim(mid('$(vFile)',index('$(vFile)','_',-1)+1)),'DDMMYYYY')) as Date,&lt;/STRONG&gt;&lt;BR /&gt;'$(vFile)' as Path&lt;BR /&gt;AutoGenerate 1;&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;P&gt;Files_needed:&lt;BR /&gt;NoConcatenate&lt;BR /&gt;first 2 LOAD *&lt;BR /&gt;Resident Files&lt;BR /&gt;Order by &lt;STRONG&gt;Date&lt;/STRONG&gt; desc;&lt;/P&gt;&lt;P&gt;DROP Table Files;&lt;/P&gt;&lt;P&gt;Data:&lt;BR /&gt;LOAD * Inline [&lt;BR /&gt;Temp ];&lt;/P&gt;&lt;P&gt;for i=1 to FieldValueCount('&lt;STRONG&gt;Date&lt;/STRONG&gt;')&lt;/P&gt;&lt;P&gt;let vFilePath = FieldValue('Path',$(i));&lt;/P&gt;&lt;P&gt;Concatenate(Data)&lt;BR /&gt;LOAD *,&lt;BR /&gt;FileBaseName() as FileName&lt;BR /&gt;FROM&lt;BR /&gt;[$(vFilePath)]&lt;BR /&gt;(ooxml, embedded labels, table is Sheet1); // you can change this highlighted part as you may have different way of loading the excel files&lt;/P&gt;&lt;P&gt;NEXT&lt;/P&gt;&lt;P&gt;DROP Table Files_needed;&lt;/P&gt;&lt;P&gt;DROP Field Temp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 09:37:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-loading/m-p/1746731#M721065</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2020-09-24T09:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: Error in loading</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-loading/m-p/1746757#M721068</link>
      <description>&lt;P&gt;It gave me nothing Mr.&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336"&gt;@Kushal_Chawda&lt;/a&gt;&amp;nbsp;.&amp;nbsp;&lt;BR /&gt;I made some modifications, it is loading correctly but the variable MONTH as seen here&amp;nbsp;&lt;/P&gt;&lt;P&gt;for i=1 to FieldValueCount('Month')&lt;/P&gt;&lt;P&gt;let&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;vFilePath&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;= FieldValue('Path',$(i));&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;let&amp;nbsp;vMonth&amp;nbsp;= FieldValue('Month',$(i));&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Concatenate(Data)&lt;BR /&gt;LOAD *,&lt;BR /&gt;FileBaseName() as&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;FileName,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;'$(vMonth)' as MONTH&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;FROM&lt;BR /&gt;&lt;EM&gt;[$(vFilePath)]&lt;/EM&gt;&lt;BR /&gt;&lt;STRONG&gt;(ooxml, embedded labels, table is Sheet1)&lt;/STRONG&gt;; // you can change this highlighted part as you may have different way of loading the excel files&lt;/P&gt;&lt;P&gt;is not working correctly. When I do max (MONTH) it gives me either 31/08/2020 instead of 09/11/2020 or a number 44086&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 11:05:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-loading/m-p/1746757#M721068</guid>
      <dc:creator>KaisGarci</dc:creator>
      <dc:date>2020-09-24T11:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: Error in loading</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-loading/m-p/1746778#M721070</link>
      <description>&lt;P&gt;I think that the problem is with the variable MONTH, but when I have 31082020 and 10072020 it gives me that 31082020 but in the case of 31082020 and 10092020 it gives me also 31082020 in the max(MONTH)&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 11:38:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-loading/m-p/1746778#M721070</guid>
      <dc:creator>KaisGarci</dc:creator>
      <dc:date>2020-09-24T11:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: Error in loading</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-loading/m-p/1746780#M721071</link>
      <description>&lt;P&gt;I suggest to consider seriously to change the filename-pattern from DDMMYYYY to YYYYMMDD which would avoid any measures to transform it during the load-statements. This may sound a bit ugly but from a practicable point of view it's often the fastest way - I did something similar already multiple times, ok. not with daily data else yearmonth and to change 2 - 5 years needs just 2 - 3 minutes.&lt;/P&gt;&lt;P&gt;With it you will keep your script much more readable and also get a proper sorting within the explorer - if the creation-date of the files is continuous you may sort for it but then you could use filetime() to get the latest files instead of evaluating the filenames.&lt;/P&gt;&lt;P&gt;Nevertheless if you want to keep by your origin approach you need to transform the date within the filename to the above mentioned structure of YYYYMMDD by ensuring that these aren't dates (are always only a formatting for the underlying number - on which functions like max() would be performed) else pure numbers.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 11:40:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-loading/m-p/1746780#M721071</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2020-09-24T11:40:44Z</dc:date>
    </item>
    <item>
      <title>Re: Error in loading</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-loading/m-p/1746786#M721072</link>
      <description>&lt;P&gt;Hello Mr.&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28038"&gt;@marcus_sommer&lt;/a&gt; . It is loading perfectly, but the issue is with the variable MONTH&amp;nbsp; (as you can see in this script)&amp;nbsp;&lt;/P&gt;&lt;P&gt;let&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;vFilePath&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;= FieldValue('Path',$(i));&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;&lt;STRONG&gt;let&amp;nbsp;vMonth&amp;nbsp;= FieldValue('Month',$(i));&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Concatenate(Data)&lt;BR /&gt;LOAD *,&lt;BR /&gt;FileBaseName() as&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;FileName,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;&lt;STRONG&gt;'$(vMonth)' as MONTH&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;It gives that 08 August is bigger than 11 September&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 11:51:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-loading/m-p/1746786#M721072</guid>
      <dc:creator>KaisGarci</dc:creator>
      <dc:date>2020-09-24T11:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: Error in loading</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-loading/m-p/1746790#M721073</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/123940"&gt;@KaisGarci&lt;/a&gt;&amp;nbsp; what is the value in&amp;nbsp; vMonth variable?&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 12:03:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-loading/m-p/1746790#M721073</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2020-09-24T12:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: Error in loading</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-loading/m-p/1746792#M721074</link>
      <description>&lt;P&gt;It is the date variable whic is based on the two files, so it gives me to values of the latest dates. But it tells me that 31 august is latest than 11 september, when I tried to change the name to Real_10082020 (10&amp;lt;11) it gives me that 11 september is latest than 31 august in this case.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 12:07:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-loading/m-p/1746792#M721074</guid>
      <dc:creator>KaisGarci</dc:creator>
      <dc:date>2020-09-24T12:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: Error in loading</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-loading/m-p/1746796#M721075</link>
      <description>&lt;P&gt;But the trick of Mr.&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28038"&gt;@marcus_sommer&lt;/a&gt;&amp;nbsp; of YYYYMMDD worked perfectly. Thank you Mr.&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28038"&gt;@marcus_sommer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 12:21:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-loading/m-p/1746796#M721075</guid>
      <dc:creator>KaisGarci</dc:creator>
      <dc:date>2020-09-24T12:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: Error in loading</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-loading/m-p/1747035#M721076</link>
      <description>&lt;P&gt;Hi, just to comment that I was curious of why you said that it's not working, I made 3 excel samples (31082020, 01092020 and 02092020) and it worked, retrieving only the 2 last files. Sample attached&lt;/P&gt;&lt;P&gt;Other than that, if you can rename the files as Marcus said has other benefits, so it's better to keep that way, but remember to include the year in the code, don't take only month and day, or in january you will find that the code is keeping the december files because the month is higher.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 06:28:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-loading/m-p/1747035#M721076</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2020-09-25T06:28:24Z</dc:date>
    </item>
    <item>
      <title>Re: Error in loading</title>
      <link>https://community.qlik.com/t5/QlikView/Error-in-loading/m-p/1747242#M721077</link>
      <description>&lt;P&gt;Hello Mr.&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/22593"&gt;@rubenmarin&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thank you for your response. Yes, the script, as you can see, is takig into consideration the whole date.&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the problem with the old format (DDMMYYYY) is that when I created a variable of the date called DATE, when I do max(DATE) it gives me the 31082020 instead of 11092020. But, with the new format (YYYYMMDD) it worked perfectly.&amp;nbsp;&lt;BR /&gt;Thank you again for your help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 15:03:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Error-in-loading/m-p/1747242#M721077</guid>
      <dc:creator>KaisGarci</dc:creator>
      <dc:date>2020-09-25T15:03:09Z</dc:date>
    </item>
  </channel>
</rss>

