Qlik Community

Qlik Sense Advanced Authoring

Discussion board where members can learn more about Qlik Sense Advanced Authoring.

Announcements
See why BI users voted Qlik #1 in 11 categories. GET REPORT
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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 (1)
3 Replies
Highlighted
Creator III
Creator III

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")  

Highlighted
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 . '';

 

 

Highlighted
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”: