<?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 Exit Script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Exit-Script/m-p/371691#M138176</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;to move the file to another directory, you can use the syntax shown in Venkat's post above&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;﻿﻿execute cmd.exe /c move c:\qv\data\myfile.txt c:\qv\data\old\myfile.txt &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW, using his sample code or taking code samples from Rob Wunderlich's "qlikview cookbook" will make your code more robust if you don't know the file name beforehand&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the "move c:\qv\data\myfile.txt c:\qv\data\old\myfile.txt" is actually a DOS command, you can use other dos commands as well (copy, del, ...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hilaire&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Apr 2012 12:09:54 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-04-27T12:09:54Z</dc:date>
    <item>
      <title>Exit Script</title>
      <link>https://community.qlik.com/t5/QlikView/Exit-Script/m-p/371686#M138171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have loaded CSV files into QVW file. Now i have a requirement such that, in load script i have to write the script which will check that whether the files exist in the specified path or not. If not then it will exit the script without any error and if yes then it will transfer the CSV files to some other&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How it can be done ??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2012 07:53:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Exit-Script/m-p/371686#M138171</guid>
      <dc:creator />
      <dc:date>2012-04-27T07:53:06Z</dc:date>
    </item>
    <item>
      <title>Exit Script</title>
      <link>https://community.qlik.com/t5/QlikView/Exit-Script/m-p/371687#M138172</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;you could test file existence in your loading script as follows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;if isnull(filetime('c:\qv\data\myfile.txt')) then&lt;/P&gt;&lt;P&gt;//do nothing&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;//file is actually there, load it&lt;/P&gt;&lt;P&gt;table_1:&lt;/P&gt;&lt;P&gt;LOAD col1, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; col2&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;C:\QV\data\myfile.txt&lt;/P&gt;&lt;P&gt;(txt, codepage is 1252, embedded labels, delimiter is '\t', msq);&lt;/P&gt;&lt;P&gt;end if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hilaire&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2012 08:04:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Exit-Script/m-p/371687#M138172</guid>
      <dc:creator />
      <dc:date>2012-04-27T08:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: Exit Script</title>
      <link>https://community.qlik.com/t5/QlikView/Exit-Script/m-p/371688#M138173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; hi,&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;try below code in edit script.&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;SPAN style="color: #0000ff;"&gt;let &lt;/SPAN&gt;vDataPath&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt; &lt;/EM&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;SPAN style="color: #808080; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;='c:\Project\Data\Source\';&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;DIRECTORY&lt;/STRONG&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;$(vDataPath)&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt; &lt;/EM&gt;&lt;SPAN style="color: #808080; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;let&lt;/STRONG&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;vMoveDataPath&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt; &lt;/EM&gt;&lt;SPAN style="color: #808080; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;='c:\Project\Data\Destination\';&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;DIRECTORY&lt;/STRONG&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;$(vMoveDataPath)&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt; &lt;/EM&gt;&lt;SPAN style="color: #808080; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;Set&lt;/STRONG&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;NoOfFiles&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 0;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;For&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;each&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;file&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;filelist&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; ('$(vDataPath)*.txt');&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;Let&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;NoOfFiles&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;NoOfFiles&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; + 1; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;next&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;If&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;NoOfFiles&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=0) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;Set&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;vNoOfFiles&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 0;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;ELSE&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;Set&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;vNoOfFiles&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; =1;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;ENDIF&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;SWITCH&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;$(vNoOfFiles)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;CASE&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; 1&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;vErrorType&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ScriptError&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;vErrorDetail&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ScriptErrorList&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;IF&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ScriptErrorCount&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=0) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;execute&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; cmd.exe /c move "$(vDataPath)*.csv" "$(vMoveDataPath)";&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;ENDIF&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;CASE&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; 0&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;EXIT&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Script&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;ENDSWITCH&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG style="color: #000000; font-size: 8pt;"&gt;i hope this helps you.&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG style="color: #000000; font-size: 8pt;"&gt;Regards&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG style="color: #000000; font-size: 8pt;"&gt;Venkat&lt;/STRONG&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2012 08:28:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Exit-Script/m-p/371688#M138173</guid>
      <dc:creator />
      <dc:date>2012-04-27T08:28:38Z</dc:date>
    </item>
    <item>
      <title>Exit Script</title>
      <link>https://community.qlik.com/t5/QlikView/Exit-Script/m-p/371689#M138174</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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; You can use the following script to match your requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if FileSize('$(FileName)')&amp;gt;0 THEN&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Load Statements&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit Script;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ENDIF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Andrew Hudson&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2012 09:06:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Exit-Script/m-p/371689#M138174</guid>
      <dc:creator>adhudson</dc:creator>
      <dc:date>2012-04-27T09:06:24Z</dc:date>
    </item>
    <item>
      <title>Exit Script</title>
      <link>https://community.qlik.com/t5/QlikView/Exit-Script/m-p/371690#M138175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Hilaire,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its working but now if mthe file is there then it should move to a specified path. How that will be done ??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2012 10:14:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Exit-Script/m-p/371690#M138175</guid>
      <dc:creator />
      <dc:date>2012-04-27T10:14:58Z</dc:date>
    </item>
    <item>
      <title>Exit Script</title>
      <link>https://community.qlik.com/t5/QlikView/Exit-Script/m-p/371691#M138176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;to move the file to another directory, you can use the syntax shown in Venkat's post above&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;﻿﻿execute cmd.exe /c move c:\qv\data\myfile.txt c:\qv\data\old\myfile.txt &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW, using his sample code or taking code samples from Rob Wunderlich's "qlikview cookbook" will make your code more robust if you don't know the file name beforehand&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the "move c:\qv\data\myfile.txt c:\qv\data\old\myfile.txt" is actually a DOS command, you can use other dos commands as well (copy, del, ...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hilaire&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2012 12:09:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Exit-Script/m-p/371691#M138176</guid>
      <dc:creator />
      <dc:date>2012-04-27T12:09:54Z</dc:date>
    </item>
  </channel>
</rss>

