Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 FROMqvd\PCPCapTableMCRProject.qvd
(qvd);
Thanks
Krishan
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.
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