<?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 multiple excel files and sheets not working in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Loading-multiple-excel-files-and-sheets-not-working/m-p/1511198#M749966</link>
    <description>&lt;P&gt;Hi Thomas,&lt;/P&gt;&lt;P&gt;thanks for your reply. However, it didn't solve my problem. Having applied your suggestions the script still keeps drawing the first sheet 4 times instead of drawing the 4 different sheets consecutively:-(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Nov 2018 15:14:01 GMT</pubDate>
    <dc:creator>ingoniclas</dc:creator>
    <dc:date>2018-11-22T15:14:01Z</dc:date>
    <item>
      <title>Loading multiple excel files and sheets not working</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-multiple-excel-files-and-sheets-not-working/m-p/1510851#M749964</link>
      <description>&lt;P&gt;Hi&amp;nbsp;there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a couple of excel files with 4 worksheets in each file that I need to load in QlikView. While searching for solutions in the community I came uop with the script below, taken form the following&amp;nbsp;sources:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://qlikviewcookbook.com/2008/09/loading-multiple-excel-sheets/" target="_blank"&gt;http://qlikviewcookbook.com/2008/09/loading-multiple-excel-sheets/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/t5/QlikView-Scripting/Loading-from-multiple-Excel-files-and-multiple-sheets/m-p/372845" target="_blank"&gt;https://community.qlik.com/t5/QlikView-Scripting/Loading-from-multiple-Excel-files-and-multiple-sheets/m-p/372845&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, for some reason it doesn't work the way it's supposed to be: I can load the table 'Sheets' with the ODBC connection, but for some reason only the first worksheet of each file gets loaded 4 times, instead of all the 4 worksheets. I couldn't figure out why this is since the script seems to be ok to me. Any ideas??? Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For&amp;nbsp;Each vFile in FileList('MyDirectory\*.xlsx')&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;ODBC&amp;nbsp;CONNECT32&amp;nbsp;To [Excel Files;DBQ=$(vFile)];&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sheets:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SQLTABLES;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DISCONNECT;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;For&amp;nbsp;i = 0 To NoOfRows('Sheets')-1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for&amp;nbsp;each vSheet in Peek(‘TABLE_NAME’, i, ‘Sheets’)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;table1:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LOAD&amp;nbsp; A, B, C …&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; From [$(vFile)]&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (ooxml, no labels, table is [$(vSheet)]);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Next&lt;BR /&gt;Next&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 21:50:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-multiple-excel-files-and-sheets-not-working/m-p/1510851#M749964</guid>
      <dc:creator>ingoniclas</dc:creator>
      <dc:date>2024-11-16T21:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: Loading multiple excel files and sheets not working</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-multiple-excel-files-and-sheets-not-working/m-p/1511154#M749965</link>
      <description>You have 3 "For" and only 2 "Next".&lt;BR /&gt;&lt;BR /&gt;I think you should just :&lt;BR /&gt;&lt;BR /&gt;1 - change this part :&lt;BR /&gt;"for each vSheet in Peek(‘TABLE_NAME’, i, ‘Sheets’)" ===&amp;gt; inconsistant&lt;BR /&gt;with&lt;BR /&gt;"let vSheet=Peek(‘TABLE_NAME’, $(i), ‘Sheets’)"===&amp;gt; define the right sheet for each i (row of sheets table)&lt;BR /&gt;&lt;BR /&gt;2 - Add this between the two "next" :&lt;BR /&gt;"Drop table Sheets;" ==&amp;gt; because you add new sheets value each time you connect to vFile without deleting the former ones&lt;BR /&gt;&lt;BR /&gt;Hope this helps !&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Thomas&lt;BR /&gt;</description>
      <pubDate>Thu, 22 Nov 2018 13:14:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-multiple-excel-files-and-sheets-not-working/m-p/1511154#M749965</guid>
      <dc:creator>thomaslg_wq</dc:creator>
      <dc:date>2018-11-22T13:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: Loading multiple excel files and sheets not working</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-multiple-excel-files-and-sheets-not-working/m-p/1511198#M749966</link>
      <description>&lt;P&gt;Hi Thomas,&lt;/P&gt;&lt;P&gt;thanks for your reply. However, it didn't solve my problem. Having applied your suggestions the script still keeps drawing the first sheet 4 times instead of drawing the 4 different sheets consecutively:-(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Nov 2018 15:14:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-multiple-excel-files-and-sheets-not-working/m-p/1511198#M749966</guid>
      <dc:creator>ingoniclas</dc:creator>
      <dc:date>2018-11-22T15:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: Loading multiple excel files and sheets not working</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-multiple-excel-files-and-sheets-not-working/m-p/1511201#M749967</link>
      <description>Something seems to be wrong with the looping throught the worksheets.</description>
      <pubDate>Thu, 22 Nov 2018 15:16:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-multiple-excel-files-and-sheets-not-working/m-p/1511201#M749967</guid>
      <dc:creator>ingoniclas</dc:creator>
      <dc:date>2018-11-22T15:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: Loading multiple excel files and sheets not working</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-multiple-excel-files-and-sheets-not-working/m-p/1511214#M749968</link>
      <description>&lt;P&gt;Just put some TRACE statements with your loop-variables within the loops and then you could see within the progress-window or within the document-log what happens in each iteration. With it it shouldn't be very difficult to detect what's wrong.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Thu, 22 Nov 2018 15:43:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-multiple-excel-files-and-sheets-not-working/m-p/1511214#M749968</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-11-22T15:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: Loading multiple excel files and sheets not working</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-multiple-excel-files-and-sheets-not-working/m-p/1511284#M749970</link>
      <description>Thanks Marcus! With the help of the log file and the TRACE statement I finally figured what was causing the problem: The worksheet names were pulled surrounded with single quotes and $ sign like 'Jun 18$'. Therefore, the variable statement let vSheet=... was empty, and so only the first (default) worksheet was pulled in. The solution was to change the variable like this:&lt;BR /&gt;&lt;BR /&gt;LET vSheet=PurgeChar(PurgeChar(Peek('TABLE_NAME', $(i), 'Sheets'), chr(39)), '$');&lt;BR /&gt;&lt;BR /&gt;Now it works like a charm!</description>
      <pubDate>Thu, 22 Nov 2018 20:51:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-multiple-excel-files-and-sheets-not-working/m-p/1511284#M749970</guid>
      <dc:creator>ingoniclas</dc:creator>
      <dc:date>2018-11-22T20:51:44Z</dc:date>
    </item>
  </channel>
</rss>

