Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to update the qvd file

Hi gurus,

i was created a qvd file,if modification is done in database how can update existing qvd file with update data

Thank you

8 Replies
Not applicable
Author

Hi Sunny,

              You can use "Incremental Load" ,to add latest added/modifed data in DB.Or else you can go full reload

-Jai

Anonymous
Not applicable
Author

More info can be found in the QlikView reference manual:

25.7 Using QVD files for incremental load

Not applicable
Author

hi prakash,

Thanks for replay but can u explain more clearly,i know how to append the data using incremental load but i dont know how to upload modified data into qvd.

suniljain
Master
Master

Script Example:

QV_Table:

SQL SELECT PrimaryKey, X, Y FROM DB_TABLE

WHERE ModificationTime >= #$(LastExecTime)#;

Concatenate LOAD PrimaryKey, X, Y FROM File.QVD

WHERE NOT Exists(PrimaryKey);

STORE QV_Table INTO File.QVD;

Not applicable
Author

Hi Sunny,

If you want to update your qvd file, you need to follow incremental procedure for that you need a primary key column

Look at this here the primary key column is TestDate and based on the max data from this field the qvd is updated.

Hope it gaves you more clarity of what you exactly want.

Sample:

          LOAD A,

            B,

            TestDate,

            C

          FROM

          $(vQvdPath)\Sample.qvd(qvd);

          MaxData:

          LOAD Timestamp(Max(TestDate),'YYYY-MM-DD hh:mm:ss') as MaxDateTime

          Resident LGUIOutputData;

          Let vMaxDateTime = Peek('MaxDateTime',-1,Sample);

          DROP Table MaxData;

          Concatenate

          SQL SELECT *

          FROM Sample.dbo.TestData

          Where TestDate  > '$(vMaxDateTime)';

          STORE Sample into $(vQvdPath)\Sample.qvd(qvd);

Regards

..............

villegasi03
Creator
Creator

I was looking for a solution to a similar question I was looking for help on and I how hoping that someone could clearify something for me.

I can see how both the example from rav 1234 and from Sunil Jain would append new records to the new qvd but I am not understanding how these methods would update a record.

If a record in the original source table has a record that all ready exists in your qvd and the record is updated then wouldnt just the lastmodified date field value be the only difference? So why the primary key to update, that didnt change so it would not add the record. My thinking was that you would use a combination of the two fields. Checking for new primary key thus adding new records to your new qvd and then checking existing primarykey fields in both sources to then check if the last modified date field changed?

quiquehm
Contributor III
Contributor III

Hi, I am getting myself familiar with incremental loads , and I found the following "guidelines" in the Qlikview Notes blog ( http://qlikviewnotes.blogspot.co.uk/2012/01/incremental-load-using-qlikview.html 😞

To utilize Incremental Load a source table must have both of the following attributes:

  •   A unique identifier -- a Primary Key -- for each row.
  • A "Modification"  column that identifies when a row was added or updated. The column type may be a Date, Datetime or ascending Revision number.

  The classic IL logic is this: 

  1. Determine the "Last reload Time". The most robust technique is to extract the max value for the "Modification" column from the Master QVD.
  2. Select rows from the database table where "Modification" is greater than "Last Reload Time".
  3. Add and update rows in the Master QVD, based on primary key.

BUT My situation is as follows :

My scenario is a bit different. I have multiple excel sheets being stored in a folder ( these are periodic extractions from the same source system, so same fields everytime ), no primary key available ( not at least without building a composite key using several fields...which affects performance seriously..and I disregarded ); also there is not any datestamp column on these files, and the way I manually create a datestamp column is by using part of the file names in the Qview script. So every file stored I name it like : yyyymmdd-abc.xls ( being yyyymmdd the date when I get the extract and store it in the folder ).Then using a "for each a in" ..function I load these files in sequence adding a datestamp field like $(a) as DateStamp. Then all is stored in a QVD file. What I need to accomplish is everytime I do a data reload I need to avoid loading all the xls files again ( and building the whole QVD again )wasting time. I would need the script to only load the newer xls files stored in the folder. Any ideas on how to set it up ?

Thanks a lot

villegasi03
Creator
Creator