<?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 Loading multiple sheets in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Loading-multiple-sheets/m-p/819176#M666822</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I ran into the problem that I wanted to load multiple sheets form 1 workbook in just 1 load statement.&lt;/P&gt;&lt;P&gt;I found some scripts saying you should connect to the Excel file using the ODBC connect line, but there is another way.&lt;/P&gt;&lt;P&gt;This one is a bit more work, but it is easier to understand I think.&lt;/P&gt;&lt;P&gt;What you need to do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, load the file into Qlikview, to see how Qlikview sees the sheet names (mostlikely there is a dollar sign behind the name)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next&lt;/P&gt;&lt;P&gt;1) In the file you want to load , create a table with field name 'SheetNames'&lt;/P&gt;&lt;P&gt;2) Type every sheet name you want to load from the file, adding '$' to the end of each sheetname&lt;/P&gt;&lt;P&gt;3) Rename the sheet of the file to 'Index'&lt;/P&gt;&lt;P&gt;4) Save it.&lt;/P&gt;&lt;P&gt;5)Use the code below&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;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;TRACE INDEXING SHEETS;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;SET var_filename='EXCELTABLE.xls'&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;INDEXING:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;LOAD SheetNames,&lt;/P&gt;
&lt;P&gt;autonumber(SheetNames) as RowNo&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;FROM&lt;/P&gt;
&lt;P&gt;[..\$(var_filename)]&lt;/P&gt;
&lt;P&gt;(biff, embedded labels, table is Index$);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;TEMPINDEX:&lt;/P&gt;
&lt;P&gt;load&lt;/P&gt;
&lt;P&gt;max(RowNo) as maxload&lt;/P&gt;
&lt;P&gt;resident INDEXING;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;TRACE SETTING LOAD VARIABLES TO DEFAULT;&lt;/P&gt;
&lt;P&gt;LET var_indexload=peek('maxload',0,'TEMPINDEX');&lt;/P&gt;
&lt;P&gt;SET var_startload=0;&lt;/P&gt;
&lt;P&gt;LET var_tabload=0;&lt;/P&gt;
&lt;P&gt;set var_tabindex='';&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;TRACE LOADING SPECIFIED SHEETS;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;DO WHILE var_tabload&amp;lt;var_indexload&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;LET var_tabindex=Peek('SheetNames',$(var_tabload),'INDEXING');&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Loop_Temp:&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;Load *&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;FROM&lt;/P&gt;
&lt;P&gt;[..\$(var_filename)]&lt;/P&gt;
&lt;P&gt;(biff, embedded labels, table is [$(var_tabindex)], filters(&lt;/P&gt;
&lt;P&gt;Remove(Row, RowCnd(CellValue, 1, StrCnd(null)))&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;LET var_tabload=var_tabload+1;&lt;/P&gt;
&lt;P&gt;LOOP&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;TRACE STORING LOOP DATA INTO QVD;&lt;/P&gt;
&lt;P&gt;STORE Loop_Temp into TempLoad.qvd (qvd);&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This one worked for me, I hope you enjoy the code!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Dec 2014 18:42:56 GMT</pubDate>
    <dc:creator>dickelsa</dc:creator>
    <dc:date>2014-12-11T18:42:56Z</dc:date>
    <item>
      <title>Loading multiple sheets</title>
      <link>https://community.qlik.com/t5/QlikView/Loading-multiple-sheets/m-p/819176#M666822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I ran into the problem that I wanted to load multiple sheets form 1 workbook in just 1 load statement.&lt;/P&gt;&lt;P&gt;I found some scripts saying you should connect to the Excel file using the ODBC connect line, but there is another way.&lt;/P&gt;&lt;P&gt;This one is a bit more work, but it is easier to understand I think.&lt;/P&gt;&lt;P&gt;What you need to do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, load the file into Qlikview, to see how Qlikview sees the sheet names (mostlikely there is a dollar sign behind the name)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next&lt;/P&gt;&lt;P&gt;1) In the file you want to load , create a table with field name 'SheetNames'&lt;/P&gt;&lt;P&gt;2) Type every sheet name you want to load from the file, adding '$' to the end of each sheetname&lt;/P&gt;&lt;P&gt;3) Rename the sheet of the file to 'Index'&lt;/P&gt;&lt;P&gt;4) Save it.&lt;/P&gt;&lt;P&gt;5)Use the code below&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;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;TRACE INDEXING SHEETS;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;SET var_filename='EXCELTABLE.xls'&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;INDEXING:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;LOAD SheetNames,&lt;/P&gt;
&lt;P&gt;autonumber(SheetNames) as RowNo&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;FROM&lt;/P&gt;
&lt;P&gt;[..\$(var_filename)]&lt;/P&gt;
&lt;P&gt;(biff, embedded labels, table is Index$);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;TEMPINDEX:&lt;/P&gt;
&lt;P&gt;load&lt;/P&gt;
&lt;P&gt;max(RowNo) as maxload&lt;/P&gt;
&lt;P&gt;resident INDEXING;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;TRACE SETTING LOAD VARIABLES TO DEFAULT;&lt;/P&gt;
&lt;P&gt;LET var_indexload=peek('maxload',0,'TEMPINDEX');&lt;/P&gt;
&lt;P&gt;SET var_startload=0;&lt;/P&gt;
&lt;P&gt;LET var_tabload=0;&lt;/P&gt;
&lt;P&gt;set var_tabindex='';&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;TRACE LOADING SPECIFIED SHEETS;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;DO WHILE var_tabload&amp;lt;var_indexload&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;LET var_tabindex=Peek('SheetNames',$(var_tabload),'INDEXING');&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Loop_Temp:&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;Load *&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;FROM&lt;/P&gt;
&lt;P&gt;[..\$(var_filename)]&lt;/P&gt;
&lt;P&gt;(biff, embedded labels, table is [$(var_tabindex)], filters(&lt;/P&gt;
&lt;P&gt;Remove(Row, RowCnd(CellValue, 1, StrCnd(null)))&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;LET var_tabload=var_tabload+1;&lt;/P&gt;
&lt;P&gt;LOOP&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;TRACE STORING LOOP DATA INTO QVD;&lt;/P&gt;
&lt;P&gt;STORE Loop_Temp into TempLoad.qvd (qvd);&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This one worked for me, I hope you enjoy the code!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Dec 2014 18:42:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Loading-multiple-sheets/m-p/819176#M666822</guid>
      <dc:creator>dickelsa</dc:creator>
      <dc:date>2014-12-11T18:42:56Z</dc:date>
    </item>
  </channel>
</rss>

