<?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 Serious error in function DoDir(Root) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Serious-error-in-function-DoDir-Root/m-p/222478#M75151</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pawel,&lt;/P&gt;&lt;P&gt;the problem is caused by the statement where $(File) is enclosed in a set of single quotes, and the structure all together doesn't work. Try the following code, it "MIGHT" work, because $(File) is not wrapped in quotes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt; Main:&lt;BR /&gt; Load&lt;BR /&gt; Name,&lt;BR /&gt; Right(Name,Len(Name)-Index(Name,'\',-1)) AS File,&lt;BR /&gt; FileSize(Name) as Size,&lt;BR /&gt; FileTime(Name) as FileTime,&lt;BR /&gt; date(subfield(FileTime(Name),' ',1),'M/D/YY') as FileDate,&lt;BR /&gt; year(FileTime(Name)) as FileYear;&lt;BR /&gt;&lt;BR /&gt; Load * Inline [&lt;BR /&gt; Name&lt;BR /&gt; $(File)] ;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Jan 2010 16:24:15 GMT</pubDate>
    <dc:creator>Oleg_Troyansky</dc:creator>
    <dc:date>2010-01-29T16:24:15Z</dc:date>
    <item>
      <title>Serious error in function DoDir(Root)</title>
      <link>https://community.qlik.com/t5/QlikView/Serious-error-in-function-DoDir-Root/m-p/222475#M75148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="hcp7"&gt;Below I've enclosed the example script from QlikView help. This function lists all files in certain location (in this case on drive C:). But it's very sensitive to one thing:&lt;/P&gt;&lt;P class="hcp7" style="font-weight: bold"&gt;Your's_best_file.qvw&lt;/P&gt;&lt;P class="hcp7"&gt;This file contain an &lt;B&gt;apostrophe&lt;/B&gt; , which causes error during the execution of this function, when this file will be found. Unfortunelly I have no idea what to do with it.&lt;/P&gt;&lt;P class="hcp7"&gt;If anybody can help me, it would be very kind of you.&lt;/P&gt;&lt;P class="hcp7"&gt;************************************************************************&lt;/P&gt;&lt;P class="hcp7"&gt;[ code ]&lt;/P&gt;&lt;P class="hcp7"&gt;// list all QV related files on disk&lt;/P&gt;&lt;P class="hcp7"&gt;sub DoDir (Root)&lt;/P&gt;&lt;P class="hcp8"&gt;for each Ext in 'qvw', 'qva', 'qvo', 'qvs'&lt;/P&gt;&lt;P class="hcp9"&gt;for each File in filelist (Root&amp;amp;' \*.' &amp;amp;Ext)&lt;/P&gt;&lt;P class="hcp10"&gt;Load '$(File)' as Name, FileSize( '$(File)' ) as&lt;/P&gt;&lt;P class="hcp10"&gt;Size, FileTime( '$(File)' ) as FileTime&lt;/P&gt;&lt;P class="hcp10"&gt;autogenerate 1;&lt;/P&gt;&lt;P class="hcp9"&gt;next File&lt;/P&gt;&lt;P class="hcp8"&gt;next Ext&lt;/P&gt;&lt;P class="hcp8"&gt;for each Dir in dirlist (Root&amp;amp;' \*' )&lt;/P&gt;&lt;P class="hcp9"&gt;call DoDir (Dir)&lt;/P&gt;&lt;P class="hcp8"&gt;next Dir&lt;/P&gt;&lt;P class="hcp7"&gt;end sub&lt;/P&gt;&lt;P class="hcp7"&gt;call DoDir ('C:')&lt;/P&gt;&lt;P class="hcp7"&gt;[/ code ]&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jan 2010 14:21:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Serious-error-in-function-DoDir-Root/m-p/222475#M75148</guid>
      <dc:creator />
      <dc:date>2010-01-26T14:21:40Z</dc:date>
    </item>
    <item>
      <title>Serious error in function DoDir(Root)</title>
      <link>https://community.qlik.com/t5/QlikView/Serious-error-in-function-DoDir-Root/m-p/222476#M75149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would change the name of the file; apostrophes in file names are not permitted. Can it not be changed?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2010 15:16:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Serious-error-in-function-DoDir-Root/m-p/222476#M75149</guid>
      <dc:creator />
      <dc:date>2010-01-29T15:16:37Z</dc:date>
    </item>
    <item>
      <title>Serious error in function DoDir(Root)</title>
      <link>https://community.qlik.com/t5/QlikView/Serious-error-in-function-DoDir-Root/m-p/222477#M75150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well the problem is that it cannot be changed. Maybe there is another way ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2010 15:20:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Serious-error-in-function-DoDir-Root/m-p/222477#M75150</guid>
      <dc:creator />
      <dc:date>2010-01-29T15:20:47Z</dc:date>
    </item>
    <item>
      <title>Serious error in function DoDir(Root)</title>
      <link>https://community.qlik.com/t5/QlikView/Serious-error-in-function-DoDir-Root/m-p/222478#M75151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pawel,&lt;/P&gt;&lt;P&gt;the problem is caused by the statement where $(File) is enclosed in a set of single quotes, and the structure all together doesn't work. Try the following code, it "MIGHT" work, because $(File) is not wrapped in quotes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt; Main:&lt;BR /&gt; Load&lt;BR /&gt; Name,&lt;BR /&gt; Right(Name,Len(Name)-Index(Name,'\',-1)) AS File,&lt;BR /&gt; FileSize(Name) as Size,&lt;BR /&gt; FileTime(Name) as FileTime,&lt;BR /&gt; date(subfield(FileTime(Name),' ',1),'M/D/YY') as FileDate,&lt;BR /&gt; year(FileTime(Name)) as FileYear;&lt;BR /&gt;&lt;BR /&gt; Load * Inline [&lt;BR /&gt; Name&lt;BR /&gt; $(File)] ;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2010 16:24:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Serious-error-in-function-DoDir-Root/m-p/222478#M75151</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2010-01-29T16:24:15Z</dc:date>
    </item>
  </channel>
</rss>

