Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Sasi3557
Contributor II
Contributor II

Deleting data from qvd

Hi all

can we completely delete data from qvd file? Is there any delete keyword to delete a part of data in qvd file or is it just limiting the data while loading data i mean with some conditions.?

 

 

Labels (2)
3 Replies
mikaelsc
Specialist
Specialist

no delete of data in a qvd, same as you don't add new data to a qvd

you create a new qvd containing the new (more data or less data) having the same name.

Data: 

Load 

*

from [lib://Mylocation/myqvd.qvd]

where myCondition;

store Data into  lib://Mylocation/myqvd.qvd (.qvd); 

(after this script, the "new" qvd will contain data only with the condition "myCondition")  

Rojarao
Contributor III
Contributor III

delete QVD Is not avaliable in Qlik, but you can reduce your data.

 

Table:
LOAD 1 AutoGenerate 0;
STORE Table into . '';

 

 

Rojarao
Contributor III
Contributor III

Try this,

 

  • Create a macro using the COM-object “Scrpting.FileSystemObject”
  • Call this macro from within your load-script

Macro:

 

public function DeleteFile(filePath)

	Set objFSO = CreateObject("Scripting.FileSystemObject") 
	Dim retVal 'as Boolean
	
	If objFSO.FileExists(filePath) Then
		Call objFSO.DeleteFile(filePath)
		retVal = true
	Else
		Set objFSO = nothing
		retVal = false
	End If 
		
	DeleteFile = retVal
	
end function

Load-Script:

SET vQvdFile = 'Sales_2011_01.qvd';
LET fileDeleted = (DeleteFile('$(vQvdFile)') = -1);

TRACE File deleted $(fileDeleted); 

To get this to work you have to lower the security-level of macro-execution and allow “System Access”: