admin 發表於 2018-2-1 21:02:16

How Do I Create &Use A QVD?

Typically QVDs are created during the execution of your QlikView load script. A STORE statement writes the current contents of a single table in your data model to a file on the disk.
The syntax for this is:
STORE TableName INTO ..\Data\FileName.qvd (QVD);Note that the STORE command can also be used to write data into a comma or tab delimited file – but that is a topic for another blog post.

QVDs can be created during the execution of any QlikView load script, but best practice is to have separate applications which deal solely with the creation of QVD files.
This “extraction layer” then handles all interaction with source databases.
Depending on the size and complexity of the data being loaded I may create one app for each table being extracted or a single app may create all QVDs for the solution (or anything elsein between).
What is important though is that the front end can be reloaded quickly from locally stored data files. This ability to refresh the presentation layer quickly can massively speed up development.

How Do I Use My QVDs?
Once you have created a data layer consisting of a number of QVDs you simply load from each QVD file in the same way you would a CSV or Excel file. The syntax is:

TableName:
LOAD
FieldList
FROM ..\Data\FileName.qvd (qvd);

Note that where with CSV or Excel files the load statement contains a chunk of information about file formats this is not required with a QVD load.
You can also use the wizard in the load script by clicking the File button and locating the QVD in the folder browser.

When loading from a QVD you can apply a number of transformations, such as renaming columns, excluding rows and adding derived columns.
Be aware though that many of these transformations will cause your QVD load to be non-optimised (which will make the load up to 100 times slower)
please see this blog post for more information: QlikView Optimised Loads.

By loading from multiple QVD’s into a single application you can build up your associative data model.
This could involve some data from QVDs (perhaps originally from different data sources) and maybe some small lookup type data values from yet another source.

As well as being a very quick way of loading data into QlikView apps QVDs can also be useful for archive – due to the excellent compression which is used in their creation.
You could, for example, store dated copies of a data set into QVDs;
your front end would then typically work off the latest version, but it would be possible to point it to an archive version of the data if required.
頁: [1]
查看完整版本: How Do I Create &Use A QVD?