<?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: Latest 3 Records in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Latest-3-Records/m-p/1035152#M922376</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;check this&lt;A href="https://www.youtube.com/watch?v=VhaIaO156JM" title="https://www.youtube.com/watch?v=VhaIaO156JM"&gt;QlikView - Loading Data From Multiple Files - YouTube&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Apr 2016 06:22:54 GMT</pubDate>
    <dc:creator>ajsjoshua</dc:creator>
    <dc:date>2016-04-28T06:22:54Z</dc:date>
    <item>
      <title>Latest 3 Records</title>
      <link>https://community.qlik.com/t5/QlikView/Latest-3-Records/m-p/1035148#M922372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;i have folder path is like&amp;nbsp;&amp;nbsp; d:\qlikview\source&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;in this i have the files like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;sales_01_01_2016.xlsx&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;sales_01_02_2016.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;sales_01_03_2016.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;sales_01_04_2016.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;sales_01_06_2016.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;sales_01_09_2016.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;sales_01_10_2016.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;i have excel like this from this folder i want load only top 3 excels it means latest TOP 3 DATES excel&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;in above example i want load only&amp;nbsp; 01_10_2016,&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;01_09_2016,&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;01_06_2016&amp;nbsp; xl files only&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;how to write automation code for this&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;tried lot but no idea?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Latest-3-Records/m-p/1035148#M922372</guid>
      <dc:creator>maniram23</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Latest 3 Records</title>
      <link>https://community.qlik.com/t5/QlikView/Latest-3-Records/m-p/1035149#M922373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check this thread you will get the idea&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/thread/75751"&gt;how to Load only the latest files?&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Apr 2016 06:09:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Latest-3-Records/m-p/1035149#M922373</guid>
      <dc:creator>avinashelite</dc:creator>
      <dc:date>2016-04-28T06:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: Latest 3 Records</title>
      <link>https://community.qlik.com/t5/QlikView/Latest-3-Records/m-p/1035150#M922374</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;Try,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="xml" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14618241788221452" jivemacro_uid="_14618241788221452" modifiedtitle="true"&gt;
&lt;P&gt;Files:&lt;/P&gt;
&lt;P&gt;LOAD &lt;/P&gt;
&lt;P&gt;Date(Date#(Right(FileBaseName(),10),'DD_MM_YYYY'))&amp;nbsp; as FileDate,&lt;/P&gt;
&lt;P&gt;FilePath()&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;&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;&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; as FileName&lt;/P&gt;
&lt;P&gt;FROM [Path\*.xlsx];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt;NoConcatenate&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Latest:&lt;/P&gt;
&lt;P&gt;First 3 LOAD&lt;/P&gt;
&lt;P&gt;FileDate,&lt;/P&gt;
&lt;P&gt;FileName&lt;/P&gt;
&lt;P&gt;Resident Files order by FileDate Desc; &lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;DROP Table Files;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;LET NumRows = NoOfRows('Latest');&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;FOR i=1 to $(NumRows)&lt;/P&gt;
&lt;P&gt;LET vFileName =FieldValue('FileName',$(i));&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt;LOAD *&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;From $(vFileName) (ooxml, embedded labels, table is Sheet1);&lt;/P&gt;
&lt;P&gt;NEXT&lt;/P&gt;


&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Apr 2016 06:17:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Latest-3-Records/m-p/1035150#M922374</guid>
      <dc:creator>tamilarasu</dc:creator>
      <dc:date>2016-04-28T06:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: Latest 3 Records</title>
      <link>https://community.qlik.com/t5/QlikView/Latest-3-Records/m-p/1035151#M922375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14618244067412094" jivemacro_uid="_14618244067412094"&gt;
&lt;P&gt;Let vPath = 'D:\qlikview\source';&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;TempDate:&lt;/P&gt;
&lt;P&gt;LOAD &lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date(Date#(SubField(Mid(FileName(),7),'.',1),'DD_MM_YYYY')) as FileDate&lt;/P&gt;
&lt;P&gt;FROM&lt;/P&gt;
&lt;P&gt;&lt;D&gt;&lt;/D&gt;&lt;/P&gt;
&lt;P&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;TempDate2:&lt;/P&gt;
&lt;P&gt;Load &lt;/P&gt;
&lt;P&gt;&amp;nbsp; RowNo() as ID, &lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date(FileDate,'DD_MM_YYYY') as FileDate &lt;/P&gt;
&lt;P&gt;Resident TempDate &lt;/P&gt;
&lt;P&gt;Where RowNo() &amp;lt; 3&lt;/P&gt;
&lt;P&gt;Order By FileDate Desc;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Drop Table TempDate;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Let vMinDate = Num(Peek('FileDate',-1,'TempDate2'));&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Final:&lt;/P&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;&amp;nbsp; *, &lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date(Date#(SubField(Mid(FileName(),7),'.',1),'DD_MM_YYYY')) as FileDate&lt;/P&gt;
&lt;P&gt;FROM&lt;/P&gt;
&lt;P&gt;&lt;D&gt;&lt;/D&gt;&lt;/P&gt;
&lt;P&gt;(ooxml, embedded labels, table is Sheet1)&lt;/P&gt;
&lt;P&gt;Where Date#(SubField(Mid(FileName(),7),'.',1),'DD_MM_YYYY') &amp;gt;= '$(vMinDate)';&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Drop Table TempDate2;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Apr 2016 06:20:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Latest-3-Records/m-p/1035151#M922375</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2016-04-28T06:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Latest 3 Records</title>
      <link>https://community.qlik.com/t5/QlikView/Latest-3-Records/m-p/1035152#M922376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;check this&lt;A href="https://www.youtube.com/watch?v=VhaIaO156JM" title="https://www.youtube.com/watch?v=VhaIaO156JM"&gt;QlikView - Loading Data From Multiple Files - YouTube&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Apr 2016 06:22:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Latest-3-Records/m-p/1035152#M922376</guid>
      <dc:creator>ajsjoshua</dc:creator>
      <dc:date>2016-04-28T06:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: Latest 3 Records</title>
      <link>https://community.qlik.com/t5/QlikView/Latest-3-Records/m-p/1035153#M922377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mani,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could try to use a for each statement to load all the files in your current directory that meet a mask, and store them temporarily in a variable. Then try to get the last three files and use for each expression again to load the data. Here is an example, I don't think is the most elegant solution, but it can help to achieve what you want:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET vPathList = '';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Get files current directory store them in a variable separated by comma. For each statement return all files in ascending order. Because of the order in which values are concatenated the first in the list is the most recent date&lt;/P&gt;&lt;P&gt;For Each file in FileList('Directory\sales*.xlsx')&lt;/P&gt;&lt;P&gt;&amp;nbsp; Set vPathList = $(file),$(vPathList);&lt;/P&gt;&lt;P&gt;NEXT file&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Create a record per file found&lt;/P&gt;&lt;P&gt;FileList:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; RowNo() as ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp; SubField('$(vPathList)', ',') as File&lt;/P&gt;&lt;P&gt;AutoGenerate(1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Get the last three files and concatenate them, add " ' " to enclose each path&lt;/P&gt;&lt;P&gt;TopThreeFiles:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; chr(39) &amp;amp; Concat(File, chr(39)&amp;amp;','&amp;amp;chr(39)) &amp;amp; chr(39) as List&lt;/P&gt;&lt;P&gt;Resident FileList&lt;/P&gt;&lt;P&gt;Where ID &amp;lt; 4;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vLoadFiles = Peek('List', 0, 'TopThreeFiles');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Tables FileList, TopThreeFiles;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Load Content of the last three files&lt;/P&gt;&lt;P&gt;FOR Each a in $(vLoadFiles)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp; //Add your load sentences here&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;NEXT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-- Karla&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Apr 2016 06:40:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Latest-3-Records/m-p/1035153#M922377</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-28T06:40:24Z</dc:date>
    </item>
  </channel>
</rss>

