7 Replies Latest reply: Jun 5, 2018 11:42 AM by Hannah Cozad RSS

    Delete or Empty QVD in Load Script

    Hannah Cozad


      I need to either delete a qvd file or empty it using the load script. I have tried both and have not been successfully.


      I have tried using the EXECUTE command and the script failed. I have tried using this to empty the files, but I get an message saying they do not exist, when they actually do exist.


      Sub EmptyQvd(qvdFilePath)


      TRACE --;

      TRACE Start EmptyQvd for file $(qvdFilePath);

      // First check if the qvd-file exists

      if (not IsNull(QvdCreateTime(qvdFilePath))) then

      TRACE ... file exists ...;


      // Check if the Qvd-file contains more than 0 records

      if(QvdNoOfRecords(qvdFilePath) > 0) then



      load *

      where 1=2;

      first 1

      load *

      from [$(qvdFilePath)](qvd);


      store tmp_qvd_table into [$(qvdFilePath)](qvd);


      Drop table tmp_qvd_table;

      end if ;


      TRACE ... file '$(qvdFilePath)' does not exist;

      end if;


      TRACE finished EmptyQvd;

      TRACE --;

      End Sub



      Call EmptyQvd('\\server\ProgramData\Qlik\Sense\Log\governanceLogContent_7.8.0-usage_file.qvd');

      Call EmptyQvd('\\server\ProgramData\Qlik\Sense\Log\governance_time_range_ops_7.8.0-usage.qvd');

      Call EmptyQvd('\\server\ProgramData\Qlik\Sense\Log\governance_date_time_ops_7.8.0-usage.qvd');