<?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: How to get current filename in filelist loop in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-get-current-filename-in-filelist-loop/m-p/1821043#M1213512</link>
    <description>&lt;P&gt;Great to hear!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jul 2021 13:17:17 GMT</pubDate>
    <dc:creator>PiEye</dc:creator>
    <dc:date>2021-07-09T13:17:17Z</dc:date>
    <item>
      <title>How to get current filename in filelist loop</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-current-filename-in-filelist-loop/m-p/1820937#M1213492</link>
      <description>&lt;P&gt;Hi I'm trying to get the filename of the current file im on in my Filelist loop and store that as a variable, is this possible? Filename() just returns a NULL value. I also need to extract the Filetime from the file too to store it as a variable.&lt;BR /&gt;&lt;BR /&gt;Example code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SET SalesFactFiles = $(vSourceDataFilePath)qvd\aggregated\monthly\*2021_salesfact.qvd;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;FOR EACH FILE IN FILELIST('$(SalesFactFiles)')&lt;/P&gt;&lt;P&gt;LET Weeklyname = FileName($(File));&lt;BR /&gt;LET SalesfactTime = FileTime($(File));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 08:52:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-current-filename-in-filelist-loop/m-p/1820937#M1213492</guid>
      <dc:creator>neil-devlin</dc:creator>
      <dc:date>2021-07-09T08:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to get current filename in filelist loop</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-current-filename-in-filelist-loop/m-p/1820941#M1213495</link>
      <description>&lt;P&gt;&amp;nbsp;Hi Neil&lt;/P&gt;&lt;P&gt;You're doing the right thing, just need to ensure correct capitalisation and wrap the dollar sign expansion in quotes:&lt;/P&gt;&lt;P&gt;FOR EACH FILE IN FILELIST('$(SalesFactFiles)')&lt;/P&gt;&lt;P&gt;LET Weeklyname = FileName('$(FILE)');&lt;BR /&gt;LET SalesfactTime = FileTime('$(FILE)');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pi&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 09:02:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-current-filename-in-filelist-loop/m-p/1820941#M1213495</guid>
      <dc:creator>PiEye</dc:creator>
      <dc:date>2021-07-09T09:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to get current filename in filelist loop</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-current-filename-in-filelist-loop/m-p/1820942#M1213496</link>
      <description>&lt;P&gt;Just to elaborate&amp;nbsp; - you were almost there with FileName() - except this is used within a LOAD statement to get the name of the currently loaded table.&lt;/P&gt;&lt;P&gt;I use it when I am doing a pull directly from a wildcarded filname:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;A,&lt;/P&gt;&lt;P&gt;B,&lt;/P&gt;&lt;P&gt;FileName() AS NameOfFile&lt;/P&gt;&lt;P&gt;FROM [../../Data/QVD/MyFile_2020*.QVD] (QVD);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pi&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 09:04:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-current-filename-in-filelist-loop/m-p/1820942#M1213496</guid>
      <dc:creator>PiEye</dc:creator>
      <dc:date>2021-07-09T09:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to get current filename in filelist loop</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-current-filename-in-filelist-loop/m-p/1820945#M1213497</link>
      <description>&lt;P&gt;&lt;EM&gt;You can't use Filename() function outside the load statement, first load it in to a field and then you could use it&amp;nbsp; to assign&amp;nbsp; to variable&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 09:14:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-current-filename-in-filelist-loop/m-p/1820945#M1213497</guid>
      <dc:creator>avinashelite</dc:creator>
      <dc:date>2021-07-09T09:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to get current filename in filelist loop</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-current-filename-in-filelist-loop/m-p/1820949#M1213498</link>
      <description>&lt;P&gt;Thanks for this Pi, this worked brilliant for FileTime but still returns NULL for FileName unfortunately, assume this can only be used in a LOAD statement as you've said? Is there any function to get the name of the current file in this instance outside of using&amp;nbsp; something like 'Right('$(FILE)', count)' ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Neil&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 09:19:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-current-filename-in-filelist-loop/m-p/1820949#M1213498</guid>
      <dc:creator>neil-devlin</dc:creator>
      <dc:date>2021-07-09T09:19:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to get current filename in filelist loop</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-current-filename-in-filelist-loop/m-p/1820964#M1213502</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/145352"&gt;@neil-devlin&lt;/a&gt;&amp;nbsp; FILE will just be the name of the file - so no need to wrap it in a formula:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LET Weeklyname = '$(FILE)';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This will return it with the full path, so yes, start from here and use a string function to parse it (hint: use"subfield" with a '/' delimiter &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Pi&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 10:17:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-current-filename-in-filelist-loop/m-p/1820964#M1213502</guid>
      <dc:creator>PiEye</dc:creator>
      <dc:date>2021-07-09T10:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to get current filename in filelist loop</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-current-filename-in-filelist-loop/m-p/1820989#M1213507</link>
      <description>&lt;P&gt;Thanks for the help Pi! Have my script doing what I need it to now &lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;. The subfield hint was very much appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Neil&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 11:40:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-current-filename-in-filelist-loop/m-p/1820989#M1213507</guid>
      <dc:creator>neil-devlin</dc:creator>
      <dc:date>2021-07-09T11:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to get current filename in filelist loop</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-current-filename-in-filelist-loop/m-p/1821043#M1213512</link>
      <description>&lt;P&gt;Great to hear!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 13:17:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-current-filename-in-filelist-loop/m-p/1821043#M1213512</guid>
      <dc:creator>PiEye</dc:creator>
      <dc:date>2021-07-09T13:17:17Z</dc:date>
    </item>
  </channel>
</rss>

