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

Add a column to existing QVD





Below is my script to load data from a QVD i created before hand. However i would like to add another column in this script and all the values in this new column will be the same.

So i need to add another column called FUND and it should be populated with SPRS for all the values.

Directory;

PCPCapTable:

LOAD

AffPdExt as DateofService

FROM

qvd\PCPCapTableMCRProject.qvd

(qvd);

Thanks

Krishan







11 Replies
Not applicable
Author

Yeah, I know this. I have such script. But to reload all of these files it can take about a week. I thought about some easier way to do this like changing a QVD file header or so.

Not applicable
Author

I've just had a similar situation, where in QVD files over time, fields may well get added in or removed, causing Qlikview to have different fields, for different QVD files and causing the Filelist qvd looping trick to stop working.  I resolved my issues with a similar script to this:

//Markets QVD Load

SET vTablesLoaded = 0;
FOR EACH File IN FILELIST ('$(vDirectory)\Markets\*.qvd')
IF $(vTablesLoaded) = 0 THEN
Markets:
LOAD
*
FROM [$(File)] (qvd);
SET vTablesLoaded = 1;
ELSE
CONCATENATE LOAD
*
FROM [$(File)] (qvd);
ENDIF
NEXT File

I essentially added in a control variable to dictate which file is a first load into Qlikview and which is a subsequent one (in that same table).  Then using an IF statement controlled the LOAD statements by setting the first one to be a standard load and the subsequent ones to be forced concatenations.  This has the effect of delivering a NULL value to the column if there was no data for the period or QVD in question.

Have a play with that and see if you can get something working.  For clarity, I have a Gender field added to some subsequent loads and now when I look at the front end any model which didn't have the Gender field in just greys out the Gender field, indicating null values, whilst all other models are able to use the field successfully.

Cheers,

Paul Dutton