Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
hlines_usacs
Creator II
Creator II

Delete or Empty QVD in Load Script

Hello,

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

tmp_qvd_table:

NoConcatenate

load *

where 1=2;

first 1

load *

from [$(qvdFilePath)](qvd);

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

Drop table tmp_qvd_table;

end if ;

else

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');

1 Solution

Accepted Solutions
mikaelsc
Specialist
Specialist

but you don't seem to be using it when calling your EmptyQVD sub...

'\\server\ProgramData\Qlik\Sense\Log\governanceLogContent_7.8.0-usage_file.qvd'


i'd expect something like

Call EmptyQvd('lib://LOGS\Log\governanceLogContent_7.8.0-usage_file.qvd');


with LOGS defined as connection : \\server\ProgramData\Qlik\Sense



View solution in original post

7 Replies
martinpohl
Partner - Master
Partner - Master

can you share the document log please?

Regards

hlines_usacs
Creator II
Creator II
Author

I am sorry, but I cannot. It has some confidential data that I cannot share. Is there a specific piece of information in the log I can summarize for you instead?

martinpohl
Partner - Master
Partner - Master

I want to see what happens if the error occurs

(How many datas are loaded, what state has your if-clause and so on)

Maybe you can reload with one file where the error occurs and delete details you don't want to share.

mikaelsc
Specialist
Specialist

does your connection exist?

(don't see a lib:// ... )

hlines_usacs
Creator II
Creator II
Author

I do have a connection. This was just a subset of the script.

mikaelsc
Specialist
Specialist

but you don't seem to be using it when calling your EmptyQVD sub...

'\\server\ProgramData\Qlik\Sense\Log\governanceLogContent_7.8.0-usage_file.qvd'


i'd expect something like

Call EmptyQvd('lib://LOGS\Log\governanceLogContent_7.8.0-usage_file.qvd');


with LOGS defined as connection : \\server\ProgramData\Qlik\Sense



hlines_usacs
Creator II
Creator II
Author

The example I was using as a reference didn't have any connections. After adding this, I was successful. Thanks!