<?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: Creating a smart loop for reading Excel sheets with (almost) the same code in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Creating-a-smart-loop-for-reading-Excel-sheets-with-almost-the/m-p/112872#M601939</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Eelco,&lt;/P&gt;&lt;P&gt;Is it compulsory that we can not maintain excel data first ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Aug 2018 08:14:30 GMT</pubDate>
    <dc:creator>quddus_mohiuddi</dc:creator>
    <dc:date>2018-08-07T08:14:30Z</dc:date>
    <item>
      <title>Creating a smart loop for reading Excel sheets with (almost) the same code</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-smart-loop-for-reading-Excel-sheets-with-almost-the/m-p/112871#M601938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Hi everyone,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;I need your help. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm trying to read various xls files. They all have the same layout. &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;I 'succeeded' to read one file, see attachment.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; text-decoration: underline;"&gt;Problem / questions:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;# 1. I would like to tilt the table so that every employee gets a separate row with values &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;# 2. Including showing the name of the employee, in stead of only Employee, Employee, etcetera.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;# 3. I want to avoid having to copy more than 500 lines of code for each file. How can I read multiple file from the same folder? (for example by applying some kind of loop).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;# 4. I suspect that this can be done smarter, by repeating each block (again by means of a kind of loop), whereby only the RecNo's have to be changed (since the rest remains more or less the same).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;I would appreciate if you can edit and upload an example, working in the same (see example as attached) qvw.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Eelco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2018 07:56:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-smart-loop-for-reading-Excel-sheets-with-almost-the/m-p/112871#M601938</guid>
      <dc:creator>cdss-developer</dc:creator>
      <dc:date>2018-08-07T07:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a smart loop for reading Excel sheets with (almost) the same code</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-smart-loop-for-reading-Excel-sheets-with-almost-the/m-p/112872#M601939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Eelco,&lt;/P&gt;&lt;P&gt;Is it compulsory that we can not maintain excel data first ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2018 08:14:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-smart-loop-for-reading-Excel-sheets-with-almost-the/m-p/112872#M601939</guid>
      <dc:creator>quddus_mohiuddi</dc:creator>
      <dc:date>2018-08-07T08:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a smart loop for reading Excel sheets with (almost) the same code</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-smart-loop-for-reading-Excel-sheets-with-almost-the/m-p/112873#M601940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Quddus&lt;SPAN style="font-size: 10pt;"&gt;, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;It's not entirely clear to me what you mean. &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;Do you mean storing the data in the memory?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;It will be ± 30 of these files that I have to read, so I think it is not that bad in terms of memory.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2018 08:24:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-smart-loop-for-reading-Excel-sheets-with-almost-the/m-p/112873#M601940</guid>
      <dc:creator>cdss-developer</dc:creator>
      <dc:date>2018-08-07T08:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a smart loop for reading Excel sheets with (almost) the same code</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-smart-loop-for-reading-Excel-sheets-with-almost-the/m-p/112874#M601941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Eelco,&lt;/P&gt;&lt;P&gt;I meant that can't we do some alteration in excel file before loading it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2018 09:10:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-smart-loop-for-reading-Excel-sheets-with-almost-the/m-p/112874#M601941</guid>
      <dc:creator>quddus_mohiuddi</dc:creator>
      <dc:date>2018-08-08T09:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a smart loop for reading Excel sheets with (almost) the same code</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-smart-loop-for-reading-Excel-sheets-with-almost-the/m-p/112875#M601942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would preferably change as little as possible to the file. First I want to see if it is possible to write a script here. If it does not work, then there is nothing else, then I will indeed have to adjust the source files.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2018 06:14:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-smart-loop-for-reading-Excel-sheets-with-almost-the/m-p/112875#M601942</guid>
      <dc:creator>cdss-developer</dc:creator>
      <dc:date>2018-08-10T06:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a smart loop for reading Excel sheets with (almost) the same code</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-smart-loop-for-reading-Excel-sheets-with-almost-the/m-p/112876#M601943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think it's a quite easy task and could be handled with a single-load statement for all data-parts and all files by using something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set vPath = '.\*.xls';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;set vCompany = 'Test-Company';&lt;/P&gt;&lt;P&gt;set vCountry = 'UK';&lt;/P&gt;&lt;P&gt;set vCurrency = 'Euro';&lt;/P&gt;&lt;P&gt;set vPeriod = 'JAN-JUN 2018';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MapRecNo:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;mapping load * inline [&lt;/P&gt;&lt;P&gt;RecNo, Part&lt;/P&gt;&lt;P&gt;6, Restaurants&lt;/P&gt;&lt;P&gt;7, Restaurants&lt;/P&gt;&lt;P&gt;8, Restaurants&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Data]:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;crosstable(Employee, Value, 9)&lt;/STRONG&gt; LOAD &lt;/P&gt;&lt;P&gt;RecNo(),&lt;/P&gt;&lt;P&gt;RoWNo(),&lt;/P&gt;&lt;P&gt;'$(vCompany)' as Company,&lt;/P&gt;&lt;P&gt;'$(vCountry)' as Country,&lt;/P&gt;&lt;P&gt;'$(vCurrency)' as Currency,&lt;/P&gt;&lt;P&gt;'$(vPeriod)' as Period,&lt;/P&gt;&lt;P&gt;//'CREDITCARD' as Type,&lt;/P&gt;&lt;P&gt;//'Restaurants' as Part,&lt;/P&gt;&lt;P&gt;pick(match(recno(), 6,7,8, ...), 'Restaurants', 'Restaurants', 'Restaurants', ....) as Part,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;applymap('MapRecNo', recno(), '#NV') as Part2,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;@1 as Detail,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @4 AS Employee1, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @5 AS Employee2, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @6 AS Employee3, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @7 AS Employee4, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @8 AS Employee5, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @9 AS Employee6, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @10 AS Employee7, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @11 AS Employee8, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @12 AS Employee9, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @13 AS Employee10&lt;/P&gt;&lt;P&gt;FROM $(vPath) (biff, no labels, table is Total$)&lt;/P&gt;&lt;P&gt;WHERE&lt;/P&gt;&lt;P&gt;// &lt;STRONG style="text-decoration: line-through;"&gt;RecNo()&amp;gt;5 and RecNo()&amp;lt;9 and&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;len(@1)&amp;gt;0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This means using a wildcard &lt;STRONG&gt;*&lt;/STRONG&gt; within the FilePath to load all files from the folder and matching the different data-parts to Part and Type categorizing with a pick(match()) or probably even better with a mapping-approach instead of repeating the load multiple times and controlling them per where-clause. The transformation from the Employee columns into rows is easily made with a crosstable-prefix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2018 06:58:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-smart-loop-for-reading-Excel-sheets-with-almost-the/m-p/112876#M601943</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-08-10T06:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a smart loop for reading Excel sheets with (almost) the same code</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-smart-loop-for-reading-Excel-sheets-with-almost-the/m-p/112877#M601944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcus,&lt;/P&gt;&lt;P&gt;Thanks for your response. &lt;/P&gt;&lt;P&gt;I get some errors when copying and running the code.&lt;/P&gt;&lt;P&gt;Can you upload a working example (qvw) for me?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2018 07:24:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-smart-loop-for-reading-Excel-sheets-with-almost-the/m-p/112877#M601944</guid>
      <dc:creator>cdss-developer</dc:creator>
      <dc:date>2018-08-10T07:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a smart loop for reading Excel sheets with (almost) the same code</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-smart-loop-for-reading-Excel-sheets-with-almost-the/m-p/112878#M601945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Which errors?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2018 07:30:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-smart-loop-for-reading-Excel-sheets-with-almost-the/m-p/112878#M601945</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-08-10T07:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a smart loop for reading Excel sheets with (almost) the same code</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-smart-loop-for-reading-Excel-sheets-with-almost-the/m-p/112879#M601946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, my mistake, The code is working now ...&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;Thank you very much. &lt;/P&gt;&lt;P&gt;I will immediately check if this is going to work for me / solves my problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2018 07:33:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-smart-loop-for-reading-Excel-sheets-with-almost-the/m-p/112879#M601946</guid>
      <dc:creator>cdss-developer</dc:creator>
      <dc:date>2018-08-10T07:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a smart loop for reading Excel sheets with (almost) the same code</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-smart-loop-for-reading-Excel-sheets-with-almost-the/m-p/112880#M601947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Marcus, this works perfectly thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you also show me how to display the employee names instead of 'Employee1', 'Employee2', etc.?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2018 07:45:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-smart-loop-for-reading-Excel-sheets-with-almost-the/m-p/112880#M601947</guid>
      <dc:creator>cdss-developer</dc:creator>
      <dc:date>2018-08-10T07:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a smart loop for reading Excel sheets with (almost) the same code</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-smart-loop-for-reading-Excel-sheets-with-almost-the/m-p/112881#M601948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could within another load add/replace the generic employee-fields with an ID or a Name with the same mapping-approach like used for matching Part and Type whereby I assume that your different files contain different employees so you will need to combine Employee and the source to match them correctly. For this you could add filebasename() as Source within the first load (by adjusting the crosstable column-offset from 9 to 10 because there would be now one more field).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2018 08:22:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-smart-loop-for-reading-Excel-sheets-with-almost-the/m-p/112881#M601948</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-08-10T08:22:07Z</dc:date>
    </item>
  </channel>
</rss>

