<?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 Help with filebasename() in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-with-filebasename/m-p/341919#M1176257</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;Unfortunately filebasename() does not work the way you expected. It takes no parameters and returns the base name of the text file currently being read. So it only works when reading a text file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get the basename in the posted script, you need to use subfield, like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// to return file name + extension&lt;/P&gt;&lt;P&gt;Subfield('$(File)', '\', SubstringCount('$(File)', '\') + 1) as FileBase&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// to return filename without extension&lt;/P&gt;&lt;P&gt;Subfield(Subfield('$(File)', '\', SubstringCount('$(File)', '\') + 1), '.', 1) as FileBase&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A little more complex, I am afraid!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 08 Apr 2012 14:07:02 GMT</pubDate>
    <dc:creator>jonathandienst</dc:creator>
    <dc:date>2012-04-08T14:07:02Z</dc:date>
    <item>
      <title>Help with filebasename()</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-filebasename/m-p/341918#M1176256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, im fairly new to Qlikview, and im having problems with filebasename, im trying to get a list of all my film files, i.e. all my avi and iso files in a directory.&amp;nbsp; I can get the filepaths, but i can't whatever i try get the filebasename to work correctly, i keep running it, and modifying but i either get errors, or blanks:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;SET ThousandSep=',';&lt;/P&gt;&lt;P&gt;SET DecimalSep='.';&lt;/P&gt;&lt;P&gt;SET MoneyThousandSep=',';&lt;/P&gt;&lt;P&gt;SET MoneyDecimalSep='.';&lt;/P&gt;&lt;P&gt;SET MoneyFormat='£#,##0.00;-£#,##0.00';&lt;/P&gt;&lt;P&gt;SET TimeFormat='hh:mm:ss';&lt;/P&gt;&lt;P&gt;SET DateFormat='DD/MM/YYYY';&lt;/P&gt;&lt;P&gt;SET TimestampFormat='DD/MM/YYYY hh:mm:ss[.fff]';&lt;/P&gt;&lt;P&gt;SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';&lt;/P&gt;&lt;P&gt;SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub DoDir (Root)&lt;/P&gt;&lt;P&gt;for each Ext in 'avi', 'iso', 'qvs', 'qvt', 'qvd'&lt;/P&gt;&lt;P&gt;for each File in filelist (Root&amp;amp;'\*.' &amp;amp;Ext)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '$(File)' as Name, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileSize( '$(File)' ) as Size, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileTime( '$(File)' ) as FileTime,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Filebasename( '$(File)' ) as FileBase,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; autogenerate 1;&lt;/P&gt;&lt;P&gt;next File&lt;/P&gt;&lt;P&gt;next Ext&lt;/P&gt;&lt;P&gt;for each Dir in dirlist (Root&amp;amp;'\*' )&lt;/P&gt;&lt;P&gt;call DoDir (Dir)&lt;/P&gt;&lt;P&gt;next Dir&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;P&gt;call DoDir ('D:')&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Apr 2012 12:36:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-filebasename/m-p/341918#M1176256</guid>
      <dc:creator />
      <dc:date>2012-04-08T12:36:22Z</dc:date>
    </item>
    <item>
      <title>Help with filebasename()</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-filebasename/m-p/341919#M1176257</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;Unfortunately filebasename() does not work the way you expected. It takes no parameters and returns the base name of the text file currently being read. So it only works when reading a text file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get the basename in the posted script, you need to use subfield, like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// to return file name + extension&lt;/P&gt;&lt;P&gt;Subfield('$(File)', '\', SubstringCount('$(File)', '\') + 1) as FileBase&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// to return filename without extension&lt;/P&gt;&lt;P&gt;Subfield(Subfield('$(File)', '\', SubstringCount('$(File)', '\') + 1), '.', 1) as FileBase&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A little more complex, I am afraid!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Apr 2012 14:07:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-filebasename/m-p/341919#M1176257</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2012-04-08T14:07:02Z</dc:date>
    </item>
    <item>
      <title>Help with filebasename()</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-filebasename/m-p/341920#M1176258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, this worked great, is there any way I could have seen this from the documentation?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Apr 2012 17:54:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-filebasename/m-p/341920#M1176258</guid>
      <dc:creator />
      <dc:date>2012-04-08T17:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: Help with filebasename()</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-filebasename/m-p/341921#M1176259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Working my way through the Qlik Sense Cookbook in 2018.&amp;nbsp; Your tip from 2012 helped me past a hurdle in Ch 3.&amp;nbsp; Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jan 2018 20:12:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-filebasename/m-p/341921#M1176259</guid>
      <dc:creator>stilldvs</dc:creator>
      <dc:date>2018-01-09T20:12:03Z</dc:date>
    </item>
  </channel>
</rss>

