<?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: Read Loop Element into Column in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Read-Loop-Element-into-Column/m-p/725061#M675562</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you please try like below?&lt;/P&gt;&lt;P&gt;set errormode=0; // setting the error mode to 0&lt;/P&gt;&lt;P&gt;// create a table keeping all the possible sheet names&lt;/P&gt;&lt;P&gt;tmpinline:&lt;/P&gt;&lt;P&gt;load * Inline [&lt;/P&gt;&lt;P&gt;sheetname&lt;/P&gt;&lt;P&gt;JAN&lt;/P&gt;&lt;P&gt;FEB&lt;/P&gt;&lt;P&gt;MAR&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;// load the total count of sheet names&lt;/P&gt;&lt;P&gt;LET vSheetCount = NoOfRows('tmpinline');&lt;/P&gt;&lt;P&gt;// load each files in a loop assume that we have book1 and book2.xlsx&lt;/P&gt;&lt;P&gt;for each vFiles in filelist('Book*.xlsx')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // load each sheet until total sheet counts&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for i = 0 to $(vSheetCount)-1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // store the sheet name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; let vSheetName = peek('sheetname',$(i),'tmpinline');&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; '$(vSheetName)' as sheetname,FileName() as filename,*&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM&amp;nbsp; [$(vFiles)] (ooxml, embedded labels, Table is '$(vSheetName)');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NEXT i&lt;/P&gt;&lt;P&gt;next vFiles&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table tmpinline;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Jul 2014 12:30:09 GMT</pubDate>
    <dc:creator>sudeepkm</dc:creator>
    <dc:date>2014-07-07T12:30:09Z</dc:date>
    <item>
      <title>Read Loop Element into Column</title>
      <link>https://community.qlik.com/t5/QlikView/Read-Loop-Element-into-Column/m-p/725054#M675555</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;&lt;/P&gt;&lt;P&gt;I am loading multiple sheets from an Excel doc into my report, but need to know which sheet the data comes from. This means I need a column in every row with the sheet name. This is what I'm trying, but it doesn't work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET i = JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC;&lt;/P&gt;&lt;P&gt;FOR Each m in $(i);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp; text('$(m)') as Month,&lt;/P&gt;&lt;P&gt;&amp;nbsp; A,&lt;/P&gt;&lt;P&gt;&amp;nbsp; B&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; FROM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; [DOC.xlsx]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; (ooxml, embedded labels, Table is [$(m)]);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;NEXT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data loads, but Month is blank on every row. How can I do this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jul 2014 11:01:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-Loop-Element-into-Column/m-p/725054#M675555</guid>
      <dc:creator>matthewjbryant</dc:creator>
      <dc:date>2014-07-07T11:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: Read Loop Element into Column</title>
      <link>https://community.qlik.com/t5/QlikView/Read-Loop-Element-into-Column/m-p/725055#M675556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your syntax for the variables aren't quite correct - try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET i = "'JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR Each m in $(i);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; '$(m)' as Month, rowno() as RowNo,&lt;/P&gt;&lt;P&gt;&amp;nbsp; A,&lt;/P&gt;&lt;P&gt;&amp;nbsp; B&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; FROM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; [DOC.xlsx]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; (ooxml, embedded labels, Table is [$(m)]);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;NEXT&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, 07 Jul 2014 11:20:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-Loop-Element-into-Column/m-p/725055#M675556</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2014-07-07T11:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: Read Loop Element into Column</title>
      <link>https://community.qlik.com/t5/QlikView/Read-Loop-Element-into-Column/m-p/725056#M675557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.qlik.com/qlik-users/27943"&gt;Marcus Sommer&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply, but as soon as I place any of the elements past JAN in quotes I get a 'Field not found' error because the sheet cannot be loaded. If I just put JAN in quotes the first 12th of all the row numbers have 'JAN' populated in them.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jul 2014 11:33:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-Loop-Element-into-Column/m-p/725056#M675557</guid>
      <dc:creator>matthewjbryant</dc:creator>
      <dc:date>2014-07-07T11:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: Read Loop Element into Column</title>
      <link>https://community.qlik.com/t5/QlikView/Read-Loop-Element-into-Column/m-p/725057#M675558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Every item in variables-list needs single-quotes and the complete variable needs double-quotes and then it worked - i have tested it.&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, 07 Jul 2014 11:41:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-Loop-Element-into-Column/m-p/725057#M675558</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2014-07-07T11:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: Read Loop Element into Column</title>
      <link>https://community.qlik.com/t5/QlikView/Read-Loop-Element-into-Column/m-p/725058#M675559</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;Does not need the outer ". This is sufficient:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET i = 'JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Having said that, it works with or without the outer quotes. However, the inner single quotes are necessary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jul 2014 11:51:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-Loop-Element-into-Column/m-p/725058#M675559</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2014-07-07T11:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: Read Loop Element into Column</title>
      <link>https://community.qlik.com/t5/QlikView/Read-Loop-Element-into-Column/m-p/725059#M675560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks &lt;A href="https://community.qlik.com/qlik-users/13229"&gt;Jonathan Dienst&lt;/A&gt; and &lt;A href="https://community.qlik.com/qlik-users/27943"&gt;Marcus Sommer&lt;/A&gt; for trying to help, but the query only works without any quotes - I too have tested it! The query will run with JAN in quotes, but no more than that for some reason. I guess this is the difference between using a set and using a variable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jul 2014 12:04:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-Loop-Element-into-Column/m-p/725059#M675560</guid>
      <dc:creator>matthewjbryant</dc:creator>
      <dc:date>2014-07-07T12:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Read Loop Element into Column</title>
      <link>https://community.qlik.com/t5/QlikView/Read-Loop-Element-into-Column/m-p/725060#M675561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For me it worked - I assume there is somewhere a little difference.&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, 07 Jul 2014 12:14:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-Loop-Element-into-Column/m-p/725060#M675561</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2014-07-07T12:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: Read Loop Element into Column</title>
      <link>https://community.qlik.com/t5/QlikView/Read-Loop-Element-into-Column/m-p/725061#M675562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you please try like below?&lt;/P&gt;&lt;P&gt;set errormode=0; // setting the error mode to 0&lt;/P&gt;&lt;P&gt;// create a table keeping all the possible sheet names&lt;/P&gt;&lt;P&gt;tmpinline:&lt;/P&gt;&lt;P&gt;load * Inline [&lt;/P&gt;&lt;P&gt;sheetname&lt;/P&gt;&lt;P&gt;JAN&lt;/P&gt;&lt;P&gt;FEB&lt;/P&gt;&lt;P&gt;MAR&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;// load the total count of sheet names&lt;/P&gt;&lt;P&gt;LET vSheetCount = NoOfRows('tmpinline');&lt;/P&gt;&lt;P&gt;// load each files in a loop assume that we have book1 and book2.xlsx&lt;/P&gt;&lt;P&gt;for each vFiles in filelist('Book*.xlsx')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // load each sheet until total sheet counts&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for i = 0 to $(vSheetCount)-1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // store the sheet name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; let vSheetName = peek('sheetname',$(i),'tmpinline');&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; '$(vSheetName)' as sheetname,FileName() as filename,*&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM&amp;nbsp; [$(vFiles)] (ooxml, embedded labels, Table is '$(vSheetName)');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NEXT i&lt;/P&gt;&lt;P&gt;next vFiles&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table tmpinline;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jul 2014 12:30:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-Loop-Element-into-Column/m-p/725061#M675562</guid>
      <dc:creator>sudeepkm</dc:creator>
      <dc:date>2014-07-07T12:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: Read Loop Element into Column</title>
      <link>https://community.qlik.com/t5/QlikView/Read-Loop-Element-into-Column/m-p/725062#M675563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help Marcus. It turns out the main problem was with the spreadsheet. Once I gave them all names and edited my LOAD to match your script worked a treat. Cheers mate!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jul 2014 13:17:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-Loop-Element-into-Column/m-p/725062#M675563</guid>
      <dc:creator>matthewjbryant</dc:creator>
      <dc:date>2014-07-07T13:17:19Z</dc:date>
    </item>
  </channel>
</rss>

