<?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 Delete File operation not working in Sense in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Delete-File-operation-not-working-in-Sense/m-p/1914466#M75346</link>
    <description>&lt;P&gt;I am using the below code to delete a file on a server if it is present. This exact code works in View but not in Sense. I have enabled Legacy Mode in Sense, so that doesn't seem to be the issue:&lt;/P&gt;
&lt;P&gt;SET vQvdFile = '\\Server1\QlikView\Operations\Master\Loader\QVD\Embrace$(vCurrentYear)Q$(vCurrentQuarter).qvd';&lt;/P&gt;
&lt;P&gt;TRACE $(vQvdFile);&lt;/P&gt;
&lt;P&gt;LET vFileDeleted = (DeleteFile('$(vQvdFile)') = -1);&lt;BR /&gt;// 0 = false&lt;BR /&gt;// -1 = true&lt;BR /&gt;TRACE File deleted $(vFileDeleted) : -1 = true, 0 = false;&lt;/P&gt;
&lt;P&gt;At design time, Sense highlights the open bracket after "DeleteFile" in red and underlines it. During runtime the following error message shows:&lt;/P&gt;
&lt;P&gt;The following error occurred:&lt;BR /&gt;Unexpected token: '(', expected one of: ')', ':', 'OPERATOR_PLUS', 'OPERATOR_MINUS', 'OPERATOR_MULTIPLICATION', 'OPERATOR_DIVISION', 'OPERATOR_STRING_CONCAT', ...&lt;BR /&gt;The error occurred here:&lt;BR /&gt;LET vFileDeleted = (DeleteFile&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;(&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;'\\Server1\QlikView\Operations\Master\Loader\QVD\TESTING\Embrace2022Q2.qvd') = -1)&lt;/P&gt;
&lt;P&gt;Any help would be appreciated as I am not sure how to interpret this error.&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;J&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Apr 2022 12:15:48 GMT</pubDate>
    <dc:creator>Jason1</dc:creator>
    <dc:date>2022-04-05T12:15:48Z</dc:date>
    <item>
      <title>Delete File operation not working in Sense</title>
      <link>https://community.qlik.com/t5/App-Development/Delete-File-operation-not-working-in-Sense/m-p/1914466#M75346</link>
      <description>&lt;P&gt;I am using the below code to delete a file on a server if it is present. This exact code works in View but not in Sense. I have enabled Legacy Mode in Sense, so that doesn't seem to be the issue:&lt;/P&gt;
&lt;P&gt;SET vQvdFile = '\\Server1\QlikView\Operations\Master\Loader\QVD\Embrace$(vCurrentYear)Q$(vCurrentQuarter).qvd';&lt;/P&gt;
&lt;P&gt;TRACE $(vQvdFile);&lt;/P&gt;
&lt;P&gt;LET vFileDeleted = (DeleteFile('$(vQvdFile)') = -1);&lt;BR /&gt;// 0 = false&lt;BR /&gt;// -1 = true&lt;BR /&gt;TRACE File deleted $(vFileDeleted) : -1 = true, 0 = false;&lt;/P&gt;
&lt;P&gt;At design time, Sense highlights the open bracket after "DeleteFile" in red and underlines it. During runtime the following error message shows:&lt;/P&gt;
&lt;P&gt;The following error occurred:&lt;BR /&gt;Unexpected token: '(', expected one of: ')', ':', 'OPERATOR_PLUS', 'OPERATOR_MINUS', 'OPERATOR_MULTIPLICATION', 'OPERATOR_DIVISION', 'OPERATOR_STRING_CONCAT', ...&lt;BR /&gt;The error occurred here:&lt;BR /&gt;LET vFileDeleted = (DeleteFile&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;(&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;'\\Server1\QlikView\Operations\Master\Loader\QVD\TESTING\Embrace2022Q2.qvd') = -1)&lt;/P&gt;
&lt;P&gt;Any help would be appreciated as I am not sure how to interpret this error.&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;J&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2022 12:15:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Delete-File-operation-not-working-in-Sense/m-p/1914466#M75346</guid>
      <dc:creator>Jason1</dc:creator>
      <dc:date>2022-04-05T12:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: Delete File operation not working in Sense</title>
      <link>https://community.qlik.com/t5/App-Development/Delete-File-operation-not-working-in-Sense/m-p/1914471#M75347</link>
      <description>&lt;P&gt;To the best extent of my knowledge, there is no DeleteFile() function in Qlik (Sense or View). Is this perhaps a customized VBscript function you created in QV?&lt;/P&gt;
&lt;P&gt;If you want to delete a file from script in QS, I believe you need to execute an operating system command, e.g.&lt;/P&gt;
&lt;P&gt;Execute cmd.exe /C del "FileName.qvd";&lt;/P&gt;
&lt;P&gt;See: &lt;A href="https://community.qlik.com/t5/App-Development/How-to-delete-QVD-file-for-load-script-in-Qlik-Sense/td-p/1536169" target="_blank"&gt;https://community.qlik.com/t5/App-Development/How-to-delete-QVD-file-for-load-script-in-Qlik-Sense/td-p/1536169&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2022 12:23:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Delete-File-operation-not-working-in-Sense/m-p/1914471#M75347</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2022-04-05T12:23:45Z</dc:date>
    </item>
    <item>
      <title>Re: Delete File operation not working in Sense</title>
      <link>https://community.qlik.com/t5/App-Development/Delete-File-operation-not-working-in-Sense/m-p/1914884#M75364</link>
      <description>&lt;P&gt;It works indeed. I can even put $() variables into the filename string:&lt;/P&gt;
&lt;P&gt;Execute cmd.exe /C del "\\WNLBI01\QlikView\Operations\Master\Loader\QVD\TESTING\Embrace$(vCurrentYear)Q$(vCurrentQuarter).qvd";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the assistance!&lt;/P&gt;
&lt;P&gt;J&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2022 06:47:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Delete-File-operation-not-working-in-Sense/m-p/1914884#M75364</guid>
      <dc:creator>Jason1</dc:creator>
      <dc:date>2022-04-06T06:47:16Z</dc:date>
    </item>
  </channel>
</rss>

