<?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 QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Use-Excel-Sheet-name/m-p/1691725#M450659</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hello. This is a good decision. Tell me how to apply it in Qlik Sense? Unfortunately, the connection string with variables does not work there.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 07 Apr 2020 17:25:11 GMT</pubDate>
    <dc:creator>maks248</dc:creator>
    <dc:date>2020-04-07T17:25:11Z</dc:date>
    <item>
      <title>Use Excel Sheet name</title>
      <link>https://community.qlik.com/t5/QlikView/Use-Excel-Sheet-name/m-p/208147#M63634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you know if it's possible to get the name of the Excel sheet which is load in my script ?&lt;/P&gt;&lt;P&gt;I don't find any function anout it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jaymerry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Feb 2011 15:27:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-Excel-Sheet-name/m-p/208147#M63634</guid>
      <dc:creator>jaymerry</dc:creator>
      <dc:date>2011-02-09T15:27:14Z</dc:date>
    </item>
    <item>
      <title>Use Excel Sheet name</title>
      <link>https://community.qlik.com/t5/QlikView/Use-Excel-Sheet-name/m-p/208148#M63635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The name of the Excelsheet, which you are loading is in the script. You may also write workbook- and sheet-name into variables and refer to them in the script.&lt;/P&gt;&lt;P&gt;If you access Excel with an ODBC-connection (not the default loader) you may read all sheetnames with SQLTABLES-command and store them into a table. Then you may inspect the possible sheetnames and select one or more, which are to be loaded.&lt;/P&gt;&lt;P&gt;Below you may find a copy from an application:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;// ======================================================================================== Load Excel-Files from one directory&lt;BR /&gt;/* All Excel-files fitting into a certain pattern will be loaded&lt;BR /&gt; individual sheets will be loaded if also fitting into certain pattern&lt;BR /&gt; file-headers are *not* used, as have changed in the past&lt;BR /&gt; each file will be documented with file- and sheetname as well as with creation-date of the file&lt;BR /&gt;*/&lt;BR /&gt;&lt;BR /&gt;// ==============================================================Scan through all Files in a Directoy matching a certain pattern&lt;BR /&gt;&lt;BR /&gt; FOR each varFile in FileList (strFileList) // ===============strFileList has been defined under "Variables"&lt;BR /&gt; ODBC CONNECT TO [Excel Files; DBQ=$(varFile)]; // ========================================DBQ= Name of Workbook&lt;BR /&gt;&lt;BR /&gt; tmp: // =====================================Read sheet-informations&lt;BR /&gt; sqltables;&lt;BR /&gt;&lt;BR /&gt; SheetNames:&lt;BR /&gt; LOAD&lt;BR /&gt; *,&lt;BR /&gt; recno() AS record;&lt;BR /&gt; LOAD&lt;BR /&gt; TABLE_NAME AS SheetName&lt;BR /&gt; RESIDENT&lt;BR /&gt; tmp&lt;BR /&gt; WHERE&lt;BR /&gt; WildMatch(TABLE_NAME, '*BD*')&lt;BR /&gt; AND NOT WildMatch(TABLE_NAME, '*_Filter*', '*Print*', '*FilterDatabase*');&lt;BR /&gt; DROP TABLE tmp;&lt;BR /&gt;&lt;BR /&gt; LET maxRec = PEEK('record', -1, 'SheetNames'); // ==============================Determine Last Table (for Loop)&lt;BR /&gt;&lt;BR /&gt; FOR i = 0 TO maxRec -1 // ========================Loop through all sheets and load data&lt;BR /&gt;&lt;BR /&gt; LET strSheet = Trim(PEEK('SheetName', i, 'SheetNames'));&lt;BR /&gt; LET strConc = chr(39) &amp;amp; Upper(Mid(strSheet, 5, 3)) &amp;amp; chr(39); // ======= Logistic Concept (SUR/DEF) from sheetname&lt;BR /&gt; LET strSiTy = chr(39) &amp;amp; Upper(Left(SubField(strSheet, ' ', 3), 4)) &amp;amp; chr(39); // ============ Read SiTy from sheetname&lt;BR /&gt; LET strSheet = PurgeChar(strSheet, chr(39));&lt;BR /&gt; LET strSheet = PurgeChar(strSheet, '_'); // ====================== used for designating sheet for reading&lt;BR /&gt; Let strSheetName = chr(39) &amp;amp; strSheet &amp;amp; chr(39); // ================== used for recording filename for each entry&lt;BR /&gt; If WildMatch(strSheet, '*DV20*', '*DV40*', '*HC40*', '*RE40*') THEN&lt;BR /&gt; Data:&lt;BR /&gt; LOAD&lt;BR /&gt; $(strConc) AS Concept,&lt;BR /&gt; $(strSiTy) AS SiTy,&lt;BR /&gt; // @1 AS Region,&lt;BR /&gt; @2 AS Port,&lt;BR /&gt; ...&lt;BR /&gt; FROM&lt;BR /&gt; [$(varFile)]&lt;BR /&gt; (biff, header is 5 lines, no labels, table is [$(strSheet)])&lt;BR /&gt; WHERE&lt;BR /&gt; Len(Trim(@2)) = 5;&lt;BR /&gt; END If&lt;BR /&gt; NEXT i&lt;BR /&gt; DROP TABLE SheetNames;&lt;BR /&gt;&lt;BR /&gt;NEXT varFile&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;HTH&lt;BR /&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Feb 2011 15:54:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-Excel-Sheet-name/m-p/208148#M63635</guid>
      <dc:creator>prieper</dc:creator>
      <dc:date>2011-02-09T15:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: Use Excel Sheet name</title>
      <link>https://community.qlik.com/t5/QlikView/Use-Excel-Sheet-name/m-p/1691725#M450659</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello. This is a good decision. Tell me how to apply it in Qlik Sense? Unfortunately, the connection string with variables does not work there.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 17:25:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-Excel-Sheet-name/m-p/1691725#M450659</guid>
      <dc:creator>maks248</dc:creator>
      <dc:date>2020-04-07T17:25:11Z</dc:date>
    </item>
  </channel>
</rss>

