Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
muz_tim
Contributor
Contributor

LOAD empty QVD

Hi @all

I am trying to load a qvd but only retain the columns and empty out the table
The code below works but it reads all the data first then drop then it. but is proving time consuming because of the size of the QVD 15gb.

LOAD
   *
FROM $(QVD_File) #this is variable that points to the qvd file
WHERE 1=0;

Is there a more efficient way of pulling just the columns similar to df.columns in python

df.columns

 

Labels (1)
1 Solution

Accepted Solutions
marksouzacosta

Not sure if this is most elegant way, but following my suggestion. You just need to replace the variables vTableName and vQVDFilename.

 

SET vTableName = 'CUSTOMER_NEW';
SET vQVDFilename = 'lib://DataFiles/CUSTOMER_NEW.qvd';

[TempLoadStatement]:
LOAD
    CONCAT([FieldName],',') AS [LoadStatement]
FROM
	[$(vQVDFilename)]
	(XmlSimple, table is [QvdTableHeader/Fields/QvdFieldHeader])
;

LET vLoadStatement = FieldValue('LoadStatement',1);

[$(vTableName)]:
LOAD * INLINE [
$(vLoadStatement)
];

STORE [$(vTableName)] INTO [$(vQVDFilename)](qvd);

DROP TABLES
  [TempLoadStatement],
  [$(vTableName)]
;

 

Read more at Data Voyagers - datavoyagers.net
Follow me on my LinkedIn | Know IPC Global at ipc-global.com

View solution in original post

2 Replies
marksouzacosta

Not sure if this is most elegant way, but following my suggestion. You just need to replace the variables vTableName and vQVDFilename.

 

SET vTableName = 'CUSTOMER_NEW';
SET vQVDFilename = 'lib://DataFiles/CUSTOMER_NEW.qvd';

[TempLoadStatement]:
LOAD
    CONCAT([FieldName],',') AS [LoadStatement]
FROM
	[$(vQVDFilename)]
	(XmlSimple, table is [QvdTableHeader/Fields/QvdFieldHeader])
;

LET vLoadStatement = FieldValue('LoadStatement',1);

[$(vTableName)]:
LOAD * INLINE [
$(vLoadStatement)
];

STORE [$(vTableName)] INTO [$(vQVDFilename)](qvd);

DROP TABLES
  [TempLoadStatement],
  [$(vTableName)]
;

 

Read more at Data Voyagers - datavoyagers.net
Follow me on my LinkedIn | Know IPC Global at ipc-global.com

muz_tim
Contributor
Contributor
Author

Thanks