<?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 automatic load loop from multiple files by year in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/automatic-load-loop-from-multiple-files-by-year/m-p/553778#M692949</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to create an automatic load script, based on data that is stored in different Access databases by year (each year in a different database).&lt;/P&gt;&lt;P&gt;I only want to load the current year and the previous two. The year is indicated in the filename, so I would like the script to use the variable name in both the loop variable (For i=...) and the filename (PathName+i ).&lt;/P&gt;&lt;P&gt;Here is how far I got so far, of course not working correctly.&lt;/P&gt;&lt;P&gt;If you have any idea on how to proceed, I would really appreciate any help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vCurrentYear = Year(Today());&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub LoadData&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For i = (Num($(vCurrentYear)–2)) To Num($(vCurrentYear))&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;OLEDB CONNECT32 TO [Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=$(vServerPathName)$(i)&amp;amp; issues report .mdb;Mode=Share Deny None;Extended Properties="";Jet OLEDB:System database="";Jet OLEDB:Registry Path="";Jet OLEDB:Database Password="";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Issues:&lt;BR /&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field2,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field3 ;&lt;BR /&gt;SQL SELECT *&lt;BR /&gt;FROM Issues;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next i&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STORE Issues into $(vServerPathName)Issues.qvd;&lt;BR /&gt;DROP TABLE Isues;&lt;/P&gt;&lt;P&gt;End Sub;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call LoadData;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 Aug 2013 12:46:22 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-08-02T12:46:22Z</dc:date>
    <item>
      <title>automatic load loop from multiple files by year</title>
      <link>https://community.qlik.com/t5/QlikView/automatic-load-loop-from-multiple-files-by-year/m-p/553778#M692949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to create an automatic load script, based on data that is stored in different Access databases by year (each year in a different database).&lt;/P&gt;&lt;P&gt;I only want to load the current year and the previous two. The year is indicated in the filename, so I would like the script to use the variable name in both the loop variable (For i=...) and the filename (PathName+i ).&lt;/P&gt;&lt;P&gt;Here is how far I got so far, of course not working correctly.&lt;/P&gt;&lt;P&gt;If you have any idea on how to proceed, I would really appreciate any help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vCurrentYear = Year(Today());&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub LoadData&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For i = (Num($(vCurrentYear)–2)) To Num($(vCurrentYear))&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;OLEDB CONNECT32 TO [Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=$(vServerPathName)$(i)&amp;amp; issues report .mdb;Mode=Share Deny None;Extended Properties="";Jet OLEDB:System database="";Jet OLEDB:Registry Path="";Jet OLEDB:Database Password="";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Issues:&lt;BR /&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field2,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field3 ;&lt;BR /&gt;SQL SELECT *&lt;BR /&gt;FROM Issues;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next i&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STORE Issues into $(vServerPathName)Issues.qvd;&lt;BR /&gt;DROP TABLE Isues;&lt;/P&gt;&lt;P&gt;End Sub;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call LoadData;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Aug 2013 12:46:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/automatic-load-loop-from-multiple-files-by-year/m-p/553778#M692949</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-08-02T12:46:22Z</dc:date>
    </item>
  </channel>
</rss>

