<?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 Check for existing .qvd file in load script. in Archived Groups</title>
    <link>https://community.qlik.com/t5/Archived-Groups/Check-for-existing-qvd-file-in-load-script/m-p/1119887#M264</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a QlikView script which loads data from a stored procedure in Clarity and then saves the data in a .qvd file. Previously I was incrementally adding to this one, now very large, .qvd file on a daily basis. I have now decided to try to automatically create separate .qvd files for each month to make things easier if anything goes wrong with the reload process on the server at any time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following script, which works great so long as I already have a .qvd file for the current month. What I need to do is check that the file exists before trying to load it and if it doesn't then go straight to the part that runs the stored procedure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="java" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14629627178873256 jive_text_macro" jivemacro_uid="_14629627178873256"&gt;
&lt;P&gt;Let vQVD = Date(MonthEnd(DayStart(now(),-1)),'MMMYYYY');&lt;/P&gt;
&lt;P&gt;set Path = \\QlikView1\QVDocumentsE\Pharmacy\MCR Data\HCDs_$(vQVD);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;HCDs:&lt;/P&gt;
&lt;P&gt;LOAD *&lt;/P&gt;
&lt;P&gt;FROM&lt;/P&gt;
&lt;P&gt;$(Path).qvd&lt;/P&gt;
&lt;P&gt;(qvd);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;HCDs:&lt;/P&gt;
&lt;P&gt;SQL exec CLARITY.dbo.SP_GO_DRUG_DISP_AND_ADMIN 'T-1', 'T-1';&lt;/P&gt;
&lt;P&gt;Store HCDs into $(Path).qvd (qvd);&lt;/P&gt;
&lt;P&gt;Drop Table HCDs;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, does anyone know how to do an If...Then...Else kind of check for files in a QlikView Script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gethyn.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Jul 2025 14:29:37 GMT</pubDate>
    <dc:creator>Gethyn</dc:creator>
    <dc:date>2025-07-22T14:29:37Z</dc:date>
    <item>
      <title>Check for existing .qvd file in load script.</title>
      <link>https://community.qlik.com/t5/Archived-Groups/Check-for-existing-qvd-file-in-load-script/m-p/1119887#M264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a QlikView script which loads data from a stored procedure in Clarity and then saves the data in a .qvd file. Previously I was incrementally adding to this one, now very large, .qvd file on a daily basis. I have now decided to try to automatically create separate .qvd files for each month to make things easier if anything goes wrong with the reload process on the server at any time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following script, which works great so long as I already have a .qvd file for the current month. What I need to do is check that the file exists before trying to load it and if it doesn't then go straight to the part that runs the stored procedure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="java" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14629627178873256 jive_text_macro" jivemacro_uid="_14629627178873256"&gt;
&lt;P&gt;Let vQVD = Date(MonthEnd(DayStart(now(),-1)),'MMMYYYY');&lt;/P&gt;
&lt;P&gt;set Path = \\QlikView1\QVDocumentsE\Pharmacy\MCR Data\HCDs_$(vQVD);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;HCDs:&lt;/P&gt;
&lt;P&gt;LOAD *&lt;/P&gt;
&lt;P&gt;FROM&lt;/P&gt;
&lt;P&gt;$(Path).qvd&lt;/P&gt;
&lt;P&gt;(qvd);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;HCDs:&lt;/P&gt;
&lt;P&gt;SQL exec CLARITY.dbo.SP_GO_DRUG_DISP_AND_ADMIN 'T-1', 'T-1';&lt;/P&gt;
&lt;P&gt;Store HCDs into $(Path).qvd (qvd);&lt;/P&gt;
&lt;P&gt;Drop Table HCDs;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, does anyone know how to do an If...Then...Else kind of check for files in a QlikView Script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gethyn.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jul 2025 14:29:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Archived-Groups/Check-for-existing-qvd-file-in-load-script/m-p/1119887#M264</guid>
      <dc:creator>Gethyn</dc:creator>
      <dc:date>2025-07-22T14:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: Check for existing .qvd file in load script.</title>
      <link>https://community.qlik.com/t5/Archived-Groups/Check-for-existing-qvd-file-in-load-script/m-p/1119888#M265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can check for QVDCreateTime():&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Let vQVDExists = not isnull(&lt;SPAN style="font-size: 13.3333px;"&gt;QVDCreateTime('$(Path)'));&lt;/SPAN&gt; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;IF vQVDExists THEN &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;HCD:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD *&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;...&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;END IF&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 May 2016 16:11:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Archived-Groups/Check-for-existing-qvd-file-in-load-script/m-p/1119888#M265</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-05-13T16:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: Check for existing .qvd file in load script.</title>
      <link>https://community.qlik.com/t5/Archived-Groups/Check-for-existing-qvd-file-in-load-script/m-p/1119889#M266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Stefan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just had to make a slight variation on your script to get it to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14633862380631699 jive_text_macro" jivemacro_uid="_14633862380631699"&gt;
&lt;P&gt;Let vQVD = Date(MonthEnd(DayStart(now(),-1)),'MMMYYYY');&lt;/P&gt;
&lt;P&gt;set Path = \\QlikView1\QVDocumentsE\Pharmacy\MCR Data\HCDs_$(vQVD);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;IF not isnull(QVDCreateTime('$(Path).qvd')) Then&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;HCDs:&lt;/P&gt;
&lt;P&gt;LOAD *&lt;/P&gt;
&lt;P&gt;FROM&lt;/P&gt;
&lt;P&gt;$(Path).qvd&lt;/P&gt;
&lt;P&gt;(qvd);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;End If&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;HCDs:&lt;/P&gt;
&lt;P&gt;SQL exec CLARITY.dbo.SP_GO_DRUG_DISP_AND_ADMIN 'T-1', 'T-1';&lt;/P&gt;
&lt;P&gt;Store HCDs into $(Path).qvd (qvd);&lt;/P&gt;
&lt;P&gt;Drop Table HCDs;&lt;/P&gt;

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 May 2016 08:12:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Archived-Groups/Check-for-existing-qvd-file-in-load-script/m-p/1119889#M266</guid>
      <dc:creator>Gethyn</dc:creator>
      <dc:date>2016-05-16T08:12:05Z</dc:date>
    </item>
  </channel>
</rss>

