<?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: Use excel sheet name in field in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Use-excel-sheet-name-in-field/m-p/529918#M198082</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to try with ODBC connection. Have a look &lt;A href="http://qlikviewnotes.blogspot.in/2008/09/loading-multiple-excel-sheets.html"&gt;here&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PFA, it would help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Aug 2013 10:12:27 GMT</pubDate>
    <dc:creator>tresB</dc:creator>
    <dc:date>2013-08-26T10:12:27Z</dc:date>
    <item>
      <title>Use excel sheet name in field</title>
      <link>https://community.qlik.com/t5/QlikView/Use-excel-sheet-name-in-field/m-p/529917#M198081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have many sheets within the excel file.&lt;/P&gt;&lt;P&gt;I'm concatenating data of each sheet with the previously loaded sheet's data. &lt;/P&gt;&lt;P&gt;Even though structure of all the load statements is same,&lt;/P&gt;&lt;P&gt;I Can't use foreach loop, because each sheet's load logic is different from another.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Within the load statement, I want to use table name i.e. sheet name of which data is being loaded.&lt;/P&gt;&lt;P&gt;This table name (sheet name) is one of the member of the composite key of the table.&lt;/P&gt;&lt;P&gt;Refer below Eg:&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_13775108920331460" jivemacro_uid="_13775108920331460" modifiedtitle="true"&gt;
&lt;P&gt;Load a,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Autonumber ( '&lt;STRONG style="font-size: 14pt;"&gt;D001&lt;/STRONG&gt;'&amp;amp;a) as [% Key]&lt;/P&gt;
&lt;P&gt;From&lt;/P&gt;
&lt;P&gt;[Data.xlsx]&lt;/P&gt;
&lt;P&gt;(ooxml, no labels, table is D001);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Load a,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b*100 as b,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Autonumber ('&lt;STRONG style="font-size: 14pt;"&gt;D299&lt;/STRONG&gt;'@a) as [% key]&lt;/P&gt;
&lt;P&gt;From&lt;/P&gt;
&lt;P&gt;[Data.xlsx]&lt;/P&gt;
&lt;P&gt;(ooxml, no labels, table is D299);&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As shown above, currently, I'm doing hard coding of the sheet name to generate % key column.&lt;/P&gt;&lt;P&gt;Is there way to achieve this dynamically, without hard coding sheet name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Abhijit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Aug 2013 10:05:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-excel-sheet-name-in-field/m-p/529917#M198081</guid>
      <dc:creator>AbhijitBansode</dc:creator>
      <dc:date>2013-08-26T10:05:40Z</dc:date>
    </item>
    <item>
      <title>Re: Use excel sheet name in field</title>
      <link>https://community.qlik.com/t5/QlikView/Use-excel-sheet-name-in-field/m-p/529918#M198082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to try with ODBC connection. Have a look &lt;A href="http://qlikviewnotes.blogspot.in/2008/09/loading-multiple-excel-sheets.html"&gt;here&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PFA, it would help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Aug 2013 10:12:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-excel-sheet-name-in-field/m-p/529918#M198082</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2013-08-26T10:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: Use excel sheet name in field</title>
      <link>https://community.qlik.com/t5/QlikView/Use-excel-sheet-name-in-field/m-p/529919#M198083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could put an extra sheet in these excel-file and create there with a small loop (for each sh in sheets ...) a list from all sheets (index, names and perhaps in groups) and used this first in your load statement to generate a variable for an appropriate load-loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Couldn't you change these file, you could create such a list also extern per vbs-script and save the result in a text-file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Aug 2013 10:35:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-excel-sheet-name-in-field/m-p/529919#M198083</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2013-08-26T10:35:22Z</dc:date>
    </item>
    <item>
      <title>Re: Use excel sheet name in field</title>
      <link>https://community.qlik.com/t5/QlikView/Use-excel-sheet-name-in-field/m-p/529920#M198084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for reply.&lt;/P&gt;&lt;P&gt;I'm not sure if ODBC connections will do the needful for me.&lt;/P&gt;&lt;P&gt;It will give me the names of sheets in the field and I need to traverse that filed to load the data form particular sheet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, As already stated, I cant use for loop for loading the data as logic of loading the same filed is different in different sheets. (column b in example)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, there is possibility that, between D001 and D299 sheets, there are other sheets, so I cant use for loop either.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Aug 2013 11:05:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-excel-sheet-name-in-field/m-p/529920#M198084</guid>
      <dc:creator>AbhijitBansode</dc:creator>
      <dc:date>2013-08-26T11:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: Use excel sheet name in field</title>
      <link>https://community.qlik.com/t5/QlikView/Use-excel-sheet-name-in-field/m-p/529921#M198085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-users/27943"&gt;Marcus Sommer&lt;/A&gt; , Thanks for reply.&lt;/P&gt;&lt;P&gt;I can not change the structure of source file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Aug 2013 11:08:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-excel-sheet-name-in-field/m-p/529921#M198085</guid>
      <dc:creator>AbhijitBansode</dc:creator>
      <dc:date>2013-08-26T11:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: Use excel sheet name in field</title>
      <link>https://community.qlik.com/t5/QlikView/Use-excel-sheet-name-in-field/m-p/529922#M198086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your field b is differently calculated based on sheet, then :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If ( $(vSheetName)= 'D001', b,If( $(vSheetName)=''D299', b*100)) as&amp;nbsp; b&amp;nbsp; // you can optimize the same using Pick(Match())&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can that be an option?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Aug 2013 11:23:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-excel-sheet-name-in-field/m-p/529922#M198086</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2013-08-26T11:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Use excel sheet name in field</title>
      <link>https://community.qlik.com/t5/QlikView/Use-excel-sheet-name-in-field/m-p/529923#M198087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;An excel-file extern per vbs to read is not very complicated - see the attachment. Also could you read the data-structure from sheet for certain conditions or different load-statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Aug 2013 11:37:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-excel-sheet-name-in-field/m-p/529923#M198087</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2013-08-26T11:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: Use excel sheet name in field</title>
      <link>https://community.qlik.com/t5/QlikView/Use-excel-sheet-name-in-field/m-p/529924#M198088</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;Here you are the solution to your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vArchivosConf = 'C:\QlikView\Pruebas\Plantillas\';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vArch = '$(vArchivosConf)'&amp;amp;'01012016.xls';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; If(Not isnull(FileTime('$(vArchivosConf)'&amp;amp;'01012016.xls'))) then //validate if exists the file&lt;/P&gt;&lt;P&gt;&amp;nbsp; // connect to eaach Excel file&lt;/P&gt;&lt;P&gt;&amp;nbsp; OLEDB CONNECT32 TO [Provider=MSDASQL.1;Persist Security Info=False;Extended Properties="DSN=Excel Files;DBQ=$(vArch);DriverId=1046;MaxBufferSize=2048;PageTimeout=5;"];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Read list of sheets&lt;/P&gt;&lt;P&gt;&amp;nbsp; Temp_Tables:&lt;/P&gt;&lt;P&gt;&amp;nbsp; sqltables;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Enumerate las hojas del archivo&lt;/P&gt;&lt;P&gt;&amp;nbsp; for iSheet = 0 to NoOfRows('Temp_Tables') - 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; let vSheetName = peek('TABLE_NAME', iSheet, 'Temp_Tables');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; let vSheetName = replace(replace(vSheetName, '$', ''), chr(39), '') &amp;amp; '$';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Metas:&lt;/P&gt;&lt;P&gt;&amp;nbsp; LOAD Codigo,&lt;/P&gt;&lt;P&gt;&amp;nbsp; '$(vSheetName)' as SheetName&lt;/P&gt;&lt;P&gt;&amp;nbsp; FROM [$(vArchivosConf)$(vArchivo)]&lt;/P&gt;&lt;P&gt;&amp;nbsp; (biff, embedded labels, table is [$(vSheetName)]);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; next&lt;/P&gt;&lt;P&gt;&amp;nbsp; DROP TABLE Temp_Tables;&lt;/P&gt;&lt;P&gt;&amp;nbsp; EXIT For;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ENDIF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope help you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Feb 2016 21:57:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-excel-sheet-name-in-field/m-p/529924#M198088</guid>
      <dc:creator />
      <dc:date>2016-02-02T21:57:00Z</dc:date>
    </item>
  </channel>
</rss>

