Download Set Analysis Primer

x

QVD Metadata

Both QlikView and Qlik Sense can interchangeably use QVD files. If you have QVD files created by QlikView and if you are embarking on Qlik Sense to develop new applications, you can leverage existing QVD files.

That said, you may want to create a Qlik Sense application to show QVD metadata from all extract layer QVD files so that developers can get some metadata information such as table name, field name, number of fields and number of rows.

Let’s go through the script step-by-step.

Load data from all QVD files in a folder

// Load QVD files

set vQVDPath = ‘lib://QVDFiles\’;

load * from $(vQVDPath)*.qvd(qvd);

Neseted FOR loops to extract QVD metadata

// Extract metadata from each QVD file

for t=0 to NoOfTables() – 1

for f=1 to NoOfFields(TableName($(t)))

 Let fname = FieldName($(f), TableName($(t)));
 Let tname = TableName($(t));

QVDMetadata:

load

// table name

‘$(tname)’ as QVDName,

// field name

FieldName($(f),’$(tname)’) as [Field Name],

// no of rows

NoOfRows(‘$(tname)’) as [Number of Rows],

// load date

today() as LoadDate

AutoGenerate 1

;

// Create a concatenated list of values for each field

 Fieldvalues:

 Load

 FieldName($(f), '$(tname)') as [Field Name],
 concat(distinct [$(fname)], '-') as values

 Resident $(tname);

next f

next t

Fields:

Load [Field Name],
subfield(values, ‘-‘) as Fieldvalues
Resident Fieldvalues
where match([Field Name], ‘Country’, ‘City’)
;

exit Script

;

Now, you can create a pivot table to show QVD name, field name along with field values.

QVD Metadata

Attend our live training and let us help you become an awesome Qlik developer

Please visit the following links to learn more about these live training and register if you are interested in these courses.

PS: You are not required to make any payment now.

We have added as much information including downloadable curriculum in order to help you determine if these courses are for you or not.

If you attend a live training, you will also receive these additional benefits:

  1. One Year FREE Pro membership to Analyticshub.io ($180 value)
  2. One Qlik Sense Certification Project with live support ($250 value)

1. Qlik Sense Data Architect Masterclass 

2. Qlik Sense Visualizations Masterclass

If you enjoyed this article, get email updates (it’s free).

* indicates required
About the author

2 Responses

Leave a Reply