<?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: Looping through Excel Sheets and Columns in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Looping-through-Excel-Sheets-and-Columns/m-p/409644#M698992</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are a couple of steps here. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First of all, to decompose the tabular structure, use the CrossTable keyword. This will transform the multiple columns into two fields, one containing the column name (ie month) and one containing the cell value. Use the cross table wizard to set this up. For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13601587389545207" jivemacro_uid="_13601587389545207"&gt;&lt;P&gt;CrossTable(Tenor, Data, 3)&lt;/P&gt;&lt;P&gt;LOAD [Funding Area], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Sub Funding Area], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Total Limit], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ON, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [1M], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [3M], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [6M], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [12M], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [2Y], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [5Y], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [10Y], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [&amp;gt;10Y], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; indtmt&lt;/P&gt;&lt;P&gt;FROM [.......xlsx]&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is [.....]);&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result table will have the columns: [Funding Area],&amp;nbsp; [Sub Funding Area],&amp;nbsp; [Total Limit], Tenor, Data. Tenor will contain the values 'ON', '1M', '3M' etc, and Data will contain the corresponding values from the fields [ON], [1M] etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now to loop over files and sheets. Use a script similar to this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13601587389536030" jivemacro_uid="_13601587389536030"&gt;&lt;P&gt;For Each zFile In FileList('$(zFilepath).xlsx')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ODBC CONNECT32 TO [Excel Files;DBQ=$(zFile)];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SpreadsheetData:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SQLTABLES;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DISCONNECT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //.... subfield zFile here to analyse components for dates etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For i = 0 to NoOfRows('SpreadsheetData') - 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Let zSheet = Peek('TABLE_NAME', $(i), 'SpreadsheetData');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //.... subfield zSheet here to analyse components for dates etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileBaseName() As SourceFile,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '$(zSheet)' As SourceSheet&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM [$(zFile)]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (ooxml, no labels, table is [$(zSheet)]); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DROP Table &lt;SPAN style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; background-color: #ffffff;"&gt;SpreadsheetData&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;Next&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The outer loop iterates over all the files matching the filepath in FileList. The ODBC connection gets the sheet names with the SQLTABLES command and returns the list of sheetnames in the table &lt;SPAN style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; background-color: #ffffff;"&gt;SpreadsheetData&lt;/SPAN&gt;. The inner loop iterates over all the sheets in the file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need to get information such as dates from the file or sheet names, you can break them up using subfield and extract the information. The comments show where you could do this. When I do this type of load, I like to know where each row came from, so I add the SourceFile and SourceSheet fields. If the sheets all contain the same structure, they should auto concatenate in Data, creating a single table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope the gets you started&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Feb 2013 13:49:27 GMT</pubDate>
    <dc:creator>jonathandienst</dc:creator>
    <dc:date>2013-02-06T13:49:27Z</dc:date>
    <item>
      <title>Looping through Excel Sheets and Columns</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-through-Excel-Sheets-and-Columns/m-p/409642#M698990</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 our company budget in the 'prescribed' tabular format of account number in Column A; and each period of 2013 extending from columns B thorugh M&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each sheet is a department which I need to tag and reference later. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My basic script on edited is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;LOAD F1 as Account, &lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; January, &lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; February, &lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; March, &lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; April, &lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; May, &lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; June, &lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; July, &lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; August, &lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; September, &lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; October, &lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; November, &lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; December, &lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;FROM&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;M&gt;&lt;/M&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;(ooxml, embedded labels, table is [R - 50040]);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was thinking that at very least I would need to do something along the lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;LOAD F1 as Account, &lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; January as Budget,&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '01' as Period,&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '50040' as Department&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;FROM&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;M&gt;&lt;/M&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;(ooxml, embedded labels, table is [R - 50040]);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;LOAD F1 as Account, &lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; February as Budget,&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '02' as Period,&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '50040' as Department&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;FROM&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;M&gt;&lt;/M&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;(ooxml, embedded labels, table is [R - 50040]);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 92 sheets with 12 months in each - even recycling the code via copy and paste etc would be poor design (at best).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am actually looking to expand my knowledge and best practice rather than just create a working but downright ugly script. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would welcome contribution please and alternate smarter approaches.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2013 12:47:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-through-Excel-Sheets-and-Columns/m-p/409642#M698990</guid>
      <dc:creator />
      <dc:date>2013-02-06T12:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through Excel Sheets and Columns</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-through-Excel-Sheets-and-Columns/m-p/409643#M698991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I have understood you have a lot of sheets containing same data (columns name);&lt;/P&gt;&lt;P&gt;If this is exact, try to define a variable that conatins sheets name and then cycle on the variable,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can read (with peek) the variable from a table for instance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2013 13:17:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-through-Excel-Sheets-and-Columns/m-p/409643#M698991</guid>
      <dc:creator>alexandros17</dc:creator>
      <dc:date>2013-02-06T13:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through Excel Sheets and Columns</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-through-Excel-Sheets-and-Columns/m-p/409644#M698992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are a couple of steps here. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First of all, to decompose the tabular structure, use the CrossTable keyword. This will transform the multiple columns into two fields, one containing the column name (ie month) and one containing the cell value. Use the cross table wizard to set this up. For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13601587389545207" jivemacro_uid="_13601587389545207"&gt;&lt;P&gt;CrossTable(Tenor, Data, 3)&lt;/P&gt;&lt;P&gt;LOAD [Funding Area], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Sub Funding Area], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Total Limit], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ON, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [1M], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [3M], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [6M], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [12M], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [2Y], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [5Y], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [10Y], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [&amp;gt;10Y], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; indtmt&lt;/P&gt;&lt;P&gt;FROM [.......xlsx]&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is [.....]);&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result table will have the columns: [Funding Area],&amp;nbsp; [Sub Funding Area],&amp;nbsp; [Total Limit], Tenor, Data. Tenor will contain the values 'ON', '1M', '3M' etc, and Data will contain the corresponding values from the fields [ON], [1M] etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now to loop over files and sheets. Use a script similar to this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13601587389536030" jivemacro_uid="_13601587389536030"&gt;&lt;P&gt;For Each zFile In FileList('$(zFilepath).xlsx')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ODBC CONNECT32 TO [Excel Files;DBQ=$(zFile)];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SpreadsheetData:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SQLTABLES;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DISCONNECT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //.... subfield zFile here to analyse components for dates etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For i = 0 to NoOfRows('SpreadsheetData') - 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Let zSheet = Peek('TABLE_NAME', $(i), 'SpreadsheetData');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //.... subfield zSheet here to analyse components for dates etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileBaseName() As SourceFile,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '$(zSheet)' As SourceSheet&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM [$(zFile)]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (ooxml, no labels, table is [$(zSheet)]); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DROP Table &lt;SPAN style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; background-color: #ffffff;"&gt;SpreadsheetData&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;Next&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The outer loop iterates over all the files matching the filepath in FileList. The ODBC connection gets the sheet names with the SQLTABLES command and returns the list of sheetnames in the table &lt;SPAN style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; background-color: #ffffff;"&gt;SpreadsheetData&lt;/SPAN&gt;. The inner loop iterates over all the sheets in the file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need to get information such as dates from the file or sheet names, you can break them up using subfield and extract the information. The comments show where you could do this. When I do this type of load, I like to know where each row came from, so I add the SourceFile and SourceSheet fields. If the sheets all contain the same structure, they should auto concatenate in Data, creating a single table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope the gets you started&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2013 13:49:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-through-Excel-Sheets-and-Columns/m-p/409644#M698992</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2013-02-06T13:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: Looping through Excel Sheets and Columns</title>
      <link>https://community.qlik.com/t5/QlikView/Looping-through-Excel-Sheets-and-Columns/m-p/409645#M698993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks - much space saved &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2013 14:16:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looping-through-Excel-Sheets-and-Columns/m-p/409645#M698993</guid>
      <dc:creator />
      <dc:date>2013-02-06T14:16:37Z</dc:date>
    </item>
  </channel>
</rss>

