How To Read Meta Data From A QlikView QVD
How To Read Meta Data From A QlikView QVD
QVD files are the backbone of any well designed QlikView application. You store your data in there and Subscribe to Blog via Email
read it out again simple. But, did you know that the QVD header holds some useful meta-data? Did you
know that could be loaded into QlikView for analysis? No? Well, read on. Enter your email address to
subscribe to this blog and receive
QVD Files Are XML Files notifications of new posts by
email.
If you have ever been inquisitive enough to open a QVD file in a text editor you will have seen that the
file starts with a chunk of XML. If you havent done this previously, why not do it now? As you look
Email Address
through the headers you will see some basic information, such as the time the QVD was created. Further
on in the header is the number of rows in the file. You may well be aware that these values can be referred
to using a number of functions, for example: SUBSCRIBE
QvdNoOfRecords('c:\QlikView\Data\MyQVD.qvd');
QvdNoOfFields('c:\QlikView\Data\MyQVD.qvd');
Connect with us
Also in the header of the file you will find information on the field structure of the QVD and the lineage of
the QVD (the initial SELECT or LOAD statements that went to build the QVD. All in all very interesting to
look at in a text editor, but there are no functions to retrieve these things.
Beyond this, the QVD turns into binary for the storing of the data itself.
You may be aware that you can load data from an XML file into QlikView. So, it stands to follow that you
Qlik Sense A Quick
can load the XML from your QVD into a table. And indeed you can.
Primer
August 1 2014
When you click the Table Files button in QlikView and select a QVD, QlikView automatically changes to
load the QVD data and shows you the content:
Why You Should
Ditch Your QlikView
Calendar Script
May 29 2014
Announcing the
Launch of AskQV
April 28 2014
Further
QlikView.Next
Thoughts
October 27 2013
Just underneath the QVD radio button is a selection for XML. When you click this a different view of the QlikView Buttons
QVD is shown: When, Why and How
May 10 2013
9 Essential QlikView
Development Tools
April 8 2013
Hidden QlikView
Features
April 2 2013
QlikView Incremental
Load
January 24 2013
Perfect Your
QlikView Data Model
December 3 2011
Search ...
Clicking Finish will insert the code to load from the XML headers into your load script. The script for the
field information looks like this:
When you Save and Reload you then have a table showing all the fields in your QVD.
If you also want to add in some header information, such as number of rows, you can add another
statement within the loop to pull in those values:
QvdTableHeader:
LOAD
1 as QVDCount,
'$(vFileName)' as [File Name],
QvBuildNo as [QV Build No],
CreatorDoc as [QVD Creator],
CreateUtcTime as [Time Created],
SourceFileSize as [Source File Size],
TableName as [Table Name],
RecordByteSize as [Record Byte Size],
NoOfRecords as [Number Of Records]
FROM [$(vFile)] (XmlSimple, Table is [QvdTableHeader]);
For completion you could also pull in the lineage table for each file. You will note that the tables will all
associate on the File Name field, as we keep this the same between tables.
With these statements in place you can then create a number of different charts and tables over the data.
You can use the resulting app to answer a whole host of questions about your data layer, such as:
Taking It Further
A recent use case I had for profiling all the QVDs in an implementation was for a server migration. After a
period of parallel running we needed to ensure that the data in all of the QVDs was the same on the server
being retired to the one being migrated to. By putting an additional loop around these statements to look
in two locations, naming the locations in each table and using a composite key (of location and file name);
I created an app that profiled QVDs from both servers. A few simple straight tables later and I was able to
say with confidence that the QVDs had the same rows on both servers.
As well as being interesting for yourself, you may find that you can turn the application into a useful
piece of living documentation for your users. They can find where fields reside in QVDs, particularly useful
if you are going to allow them to self serve in Sense, for example.
I hope you find this post useful and it points you towards new ways of making the most of your QVDs.
Steve is a 2014 Qlik Luminary and Technical Editor of a number of QlikView Books. Steve
says: QlikView enables me to deliver excellent solutions to my customers - so I like to give
back by contributing on QlikCommunity and through the posts on this blog. I hope you
enjoy reading them. You can follow me on Twitter and LinkedIn or contact me via email.
5 Comments
It gets even more interesting when you start examine the XML part of the qvw.
Indeed Johan. I can recommend QViewer for a quick and simple way of viewing the
headers in one QVD at a time. This approach however allows you to do that across many QVDs in
seconds.
Brian August 19, 2014 at 1:02 am - Reply
Its quite easy and very helpful thank you Steve for such nice tutorial
Leave A Comment
Leave a Reply
We offer a range of services How To Read Meta Data From A QlikView QlikView Business Discovery Quick Intelligence Ltd
QVD
around the QlikView business 30 Norman Keep, Warfield,
QVSource API Connector
discovery platform. From analysis, Qlik Sense A Quick Primer Bracknell, Berkshire, RG42 7UY
development and training to
NPrinting Reports Phone: 01344 988782
supporting your environment. Back To Basics: How To Use Preceding
Load In QlikView Email:
Training
[email protected]
How To Connect To A Secure Site With
QlikView and QVSource
CONTACT US
Why You Should Ditch Your QlikView
Calendar Script
Copyright 2013 Quick Intelligence Ltd. VAT Reg No: 977 0628 82 Registered in the UK: 6997354