<?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: Loading top 3 excel sheets from folder? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Loading-top-3-excel-sheets-from-folder/m-p/1064522#M934955</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;First you load the one file &lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;after that you can write the above the load file&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;for each sheetname 'jan$' ,&lt;SPAN style="font-size: 13.3333px;"&gt; 'feb$',&lt;SPAN style="font-size: 13.3333px;"&gt;'mar$'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;fields name&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;path&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;and at the path at the name you give the name $(&lt;SPAN style="font-size: 13.3333px;"&gt;sheetname ) than you can load the file load the want you want the files that files are come&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Mar 2016 05:14:00 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-03-02T05:14:00Z</dc:date>
    <item>
      <title>Loading top 3 excel sheets from folder?</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-top-3-excel-sheets-from-folder/m-p/1064518#M934951</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;i have folder path is like&amp;nbsp;&amp;nbsp; d:\qlikview\source&lt;/P&gt;&lt;P&gt;in this i have the files like &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sales_01_01_2016.xlsx&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;sales_01_02_2016.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;sales_01_03_2016.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;sales_01_04_2016.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;sales_01_06_2016.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;sales_01_09_2016.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;sales_01_10_2016.xlsx&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&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&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;in above example i want load only&amp;nbsp; 01_10_2016,&lt;SPAN style="font-size: 13.3333px;"&gt;01_09_2016,&lt;SPAN style="font-size: 13.3333px;"&gt;01_06_2016&amp;nbsp; xl files only &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;how to write automation code for this &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;tried lot but no idea?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2016 19:02:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-top-3-excel-sheets-from-folder/m-p/1064518#M934951</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-01T19:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: Loading top 3 excel sheets from folder?</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-top-3-excel-sheets-from-folder/m-p/1064519#M934952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a general approach:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR EACH vFile IN FILELIST(..)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '$(vFile)' as FileName,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date#(Mid('$(vFile)',7,10),'MM_DD_YYYY') as Date&lt;/P&gt;&lt;P&gt;Autogenerate 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NEXT vFile&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to create a table with all file names and file dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Then sort your table by Date desc and PEEK() the top 3 FileName values into variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) Use another FOR EACH vFile IN FILELIST(..)&lt;/P&gt;&lt;P&gt;to load the top 3 files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Look into Help for explanations and sample code for all mentioned functions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2016 19:20:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-top-3-excel-sheets-from-folder/m-p/1064519#M934952</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-03-01T19:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: Loading top 3 excel sheets from folder?</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-top-3-excel-sheets-from-folder/m-p/1064520#M934953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for reply &lt;/P&gt;&lt;P&gt;i tried in the same way but i did not get it&lt;/P&gt;&lt;P&gt;set vpath='D:\SOURCE\Newfolder';&lt;/P&gt;&lt;P&gt;for each vb in FileList('D:\SOURCE\Newfolder\Transact*.xlsx');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T1:&lt;/P&gt;&lt;P&gt;LOAD Distinct [Transaction ID], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Order Date], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Salesman ID], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Product ID], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Serial No], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ID Customer], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '$(vb)' as source,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [List Price], RowNo() as row,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileBaseName() AS NAME,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATE(date#(right(FileBaseName(),10),'MM-DD-YYYY'),'MM/DD/YYYY') as PERIOD,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sales, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Gross Margin]&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;$(vb)&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Transact);&lt;/P&gt;&lt;P&gt;next vb&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T2:&lt;/P&gt;&lt;P&gt; LOAD Distinct *,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1 as a&lt;/P&gt;&lt;P&gt;Resident T1&lt;/P&gt;&lt;P&gt;Order by PERIOD desc;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table T1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET VPEEK0=Peek('PERIOD',-5,'T2');&lt;/P&gt;&lt;P&gt;LET VPEEK1=Peek('PERIOD',-1,'T2');&lt;/P&gt;&lt;P&gt;LET VPEEK2=Peek('PERIOD',-2,'T2');&lt;/P&gt;&lt;P&gt;LET VPEEK3=Peek('PERIOD',-3,'T2');&lt;/P&gt;&lt;P&gt;LET VPEEK4=Peek('PERIOD',-4,'T2');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here it self all the peek variables are giving same date &lt;/P&gt;&lt;P&gt;i felt that here is the issue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pls advice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Mar 2016 05:01:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-top-3-excel-sheets-from-folder/m-p/1064520#M934953</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-02T05:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: Loading top 3 excel sheets from folder?</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-top-3-excel-sheets-from-folder/m-p/1064521#M934954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First you load the one file &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after that you can write the above the load file&lt;/P&gt;&lt;P&gt;for each sheetname 'jan$' ,&lt;SPAN style="font-size: 13.3333px;"&gt; 'feb$',&lt;SPAN style="font-size: 13.3333px;"&gt;'mar$'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;fields name&lt;/P&gt;&lt;P&gt;path&lt;/P&gt;&lt;P&gt;and at the path at the name you give the name $(&lt;SPAN style="font-size: 13.3333px;"&gt;sheetname ) than you can load the file load the want you want the files that files are come&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Mar 2016 05:11:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-top-3-excel-sheets-from-folder/m-p/1064521#M934954</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-02T05:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: Loading top 3 excel sheets from folder?</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-top-3-excel-sheets-from-folder/m-p/1064522#M934955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;First you load the one file &lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;after that you can write the above the load file&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;for each sheetname 'jan$' ,&lt;SPAN style="font-size: 13.3333px;"&gt; 'feb$',&lt;SPAN style="font-size: 13.3333px;"&gt;'mar$'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;fields name&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;path&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;and at the path at the name you give the name $(&lt;SPAN style="font-size: 13.3333px;"&gt;sheetname ) than you can load the file load the want you want the files that files are come&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Mar 2016 05:14:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-top-3-excel-sheets-from-folder/m-p/1064522#M934955</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-02T05:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: Loading top 3 excel sheets from folder?</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-top-3-excel-sheets-from-folder/m-p/1064523#M934956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have a look how I generated 1 record per file name using autogerate while you are generating as many records as the input tables show. I load the table records after filtering&amp;nbsp; the dates.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Mar 2016 07:55:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-top-3-excel-sheets-from-folder/m-p/1064523#M934956</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-03-02T07:55:34Z</dc:date>
    </item>
  </channel>
</rss>

