<?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 Load files into QV in Descending Order in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Load-files-into-QV-in-Descending-Order/m-p/512941#M191640</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;Have any of you found a way to load files into Qlikview in descending order?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have over 100 csv files (all have the same structure) with sales data that I need to load into a QVD.&lt;/P&gt;&lt;P&gt;Each csv files has 8 days worth of data, so we can expect a sales order to appear 8 times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to load these files in descending order so that I load the most recent occurrence of the order first and then ignore the duplicates by using the EXISTS command in QV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I run the load normally, it loads the oldest file first and therefore keeps the oldest version of the sales order.&lt;/P&gt;&lt;P&gt;I need to keep the most recent version and I do not want to load these files 1 at a time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Oct 2013 10:56:01 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-10-04T10:56:01Z</dc:date>
    <item>
      <title>Load files into QV in Descending Order</title>
      <link>https://community.qlik.com/t5/QlikView/Load-files-into-QV-in-Descending-Order/m-p/512941#M191640</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;Have any of you found a way to load files into Qlikview in descending order?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have over 100 csv files (all have the same structure) with sales data that I need to load into a QVD.&lt;/P&gt;&lt;P&gt;Each csv files has 8 days worth of data, so we can expect a sales order to appear 8 times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to load these files in descending order so that I load the most recent occurrence of the order first and then ignore the duplicates by using the EXISTS command in QV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I run the load normally, it loads the oldest file first and therefore keeps the oldest version of the sales order.&lt;/P&gt;&lt;P&gt;I need to keep the most recent version and I do not want to load these files 1 at a time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Oct 2013 10:56:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-files-into-QV-in-Descending-Order/m-p/512941#M191640</guid>
      <dc:creator />
      <dc:date>2013-10-04T10:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: Load files into QV in Descending Order</title>
      <link>https://community.qlik.com/t5/QlikView/Load-files-into-QV-in-Descending-Order/m-p/512942#M191641</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;You could do an initial load of just the filenames, then using a for loop and peek, load them in reverse order. Here's what I mean in sudo-code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sourcefiles:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filename() as csv_file&lt;/P&gt;&lt;P&gt;FROM [*.csv];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For i = 0 to NoOfRows('sourcefiles')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Let reverseRowId = NoOfRows('sourcefiles')-$(i);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Let fileToLoad = peek('csvFile',$(reverseRowId),'sourcefiles');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fields&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM [$(fileToLoad).csv]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Where Not Exist(ID);&lt;/P&gt;&lt;P&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;Sorry, it's a bit rushed, so I apologise if I've made a mistake, but hopefully the principle will work for you.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Oct 2013 12:13:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-files-into-QV-in-Descending-Order/m-p/512942#M191641</guid>
      <dc:creator />
      <dc:date>2013-10-04T12:13:14Z</dc:date>
    </item>
  </channel>
</rss>

