<?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: Load Files based on data in a Field in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Load-Files-based-on-data-in-a-Field/m-p/1346715#M414372</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No problem at all &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Jul 2017 11:58:30 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2017-07-07T11:58:30Z</dc:date>
    <item>
      <title>Load Files based on data in a Field</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Files-based-on-data-in-a-Field/m-p/1346707#M414364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've got a script to loop through a number of folders to load some spreadsheets. Currently I can either loop through all folders&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;for each dir in DirList('..\SOURCE\*')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or loop through specific folders&lt;/P&gt;&lt;P&gt;i.e.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;for each dir in 'OCT','NOV'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;What I would like to do is load only specific folders based on the contents of a field&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;i.e.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;&lt;IMG alt="folders.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/169400_folders.PNG" style="height: auto;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see the attached example of my work so far and some same data. Can anyone please help?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jul 2017 08:23:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Files-based-on-data-in-a-Field/m-p/1346707#M414364</guid>
      <dc:creator>shane_spencer</dc:creator>
      <dc:date>2017-07-07T08:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: Load Files based on data in a Field</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Files-based-on-data-in-a-Field/m-p/1346708#M414365</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;P;ease find the below change in code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FolderList:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD concat(chr(39)&amp;amp;Folders&amp;amp;chr(39),',') as FolderList&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM [Folders.xlsx]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(ooxml, embedded labels, table is Sheet1);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Let vListOfFolder = Peek('FolderList',0,'FolderList');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for each dir in &lt;STRONG&gt;$(vListOfFolder)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;for each datafile in FileList('..\SOURCE\$(dir)\DATA.xlsx')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Monthly:&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;// '$(datafile)' as filepath,&lt;/P&gt;&lt;P&gt;'$(dir)' as Month&lt;/P&gt;&lt;P&gt;//FROM [DATA.xlsx]&lt;/P&gt;&lt;P&gt;//FROM [..\SOURCE\$(dir)\*.xlsx]&lt;/P&gt;&lt;P&gt;FROm $(datafile)&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P&gt;next datafile&lt;/P&gt;&lt;P&gt;next dir&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi Balar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jul 2017 08:46:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Files-based-on-data-in-a-Field/m-p/1346708#M414365</guid>
      <dc:creator>balar025</dc:creator>
      <dc:date>2017-07-07T08:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: Load Files based on data in a Field</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Files-based-on-data-in-a-Field/m-p/1346709#M414366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FOR i = 1 to FieldValueCount('Folders')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LET vFolder = FieldValue('Folders', $(i));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LET datafile = '..\SOURCE\$(vFolder)\DATA.xlsx';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Monthly:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD *,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;'$(dir)' as Month&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM $(datafile)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(ooxml, embedded labels, table is Sheet1);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NEXT i&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jul 2017 08:52:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Files-based-on-data-in-a-Field/m-p/1346709#M414366</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-07-07T08:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: Load Files based on data in a Field</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Files-based-on-data-in-a-Field/m-p/1346710#M414367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As per observation, in your script it will not handle if folder is not present.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Ravi Balar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jul 2017 09:01:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Files-based-on-data-in-a-Field/m-p/1346710#M414367</guid>
      <dc:creator>balar025</dc:creator>
      <dc:date>2017-07-07T09:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: Load Files based on data in a Field</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Files-based-on-data-in-a-Field/m-p/1346711#M414368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks - I'll keep this as an example, but I think Ravi's answer is closer to what I was working on myself using concatenate though I was only about 25% there.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jul 2017 09:28:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Files-based-on-data-in-a-Field/m-p/1346711#M414368</guid>
      <dc:creator>shane_spencer</dc:creator>
      <dc:date>2017-07-07T09:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: Load Files based on data in a Field</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Files-based-on-data-in-a-Field/m-p/1346712#M414369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are ways around that to make it work.... personally, I used to use Concatenate, but the reason i stopped using Concatenate is because it slows done the reload time. In this case the list to be concatenated is small, so it doesn't matter. But for a longer list (of say 15000 or 50000), its better to use FieldValue functions instead of Concat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jul 2017 11:05:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Files-based-on-data-in-a-Field/m-p/1346712#M414369</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-07-07T11:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: Load Files based on data in a Field</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Files-based-on-data-in-a-Field/m-p/1346713#M414370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Like I mentioned above, for your data it might not make a difference, but FieldValue is def. something you would want to use because of its capability to look at DISTINCT values outside of a table &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jul 2017 11:07:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Files-based-on-data-in-a-Field/m-p/1346713#M414370</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-07-07T11:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: Load Files based on data in a Field</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Files-based-on-data-in-a-Field/m-p/1346714#M414371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you. And thank you for the explanation of advantages too!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jul 2017 11:58:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Files-based-on-data-in-a-Field/m-p/1346714#M414371</guid>
      <dc:creator>shane_spencer</dc:creator>
      <dc:date>2017-07-07T11:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: Load Files based on data in a Field</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Files-based-on-data-in-a-Field/m-p/1346715#M414372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No problem at all &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jul 2017 11:58:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Files-based-on-data-in-a-Field/m-p/1346715#M414372</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-07-07T11:58:30Z</dc:date>
    </item>
  </channel>
</rss>

