Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to merge two QVW's or scripts?

Hi all. I've got two QVW's that generate data models from two different sources. I want to merge them together into a third combined model. I can use the BINARY load to pull in the first data set, but I guess I can only do that once. How can I then merge with the second? Is there a way to import the script from the second and run it? I don't want to have to manage two versions of the same script, as it changes regularly. Is there something like an "include" or "import" command to have it simply import the script from the second QVW and run it? Or is there a way to effectively do two binary loads? Thanks for the help!

Eric

1 Reply
johnw
Champion III
Champion III

You can't do two binary loads, and even though I believe there's the equivalent of an "include", there's also no reason to run the same script twice. I believe the normal approach for something like this would be to store the tables from each of the first two QVWs as QVDs. For example, let's say your first QVW loads two tables, OrderItem and Customer. At the end of the script, do this:

STORE OrderItem INTO OrderItem.qvd;
STORE Customer INTO Customer.qvd;

And let's say your second QVW loads a Product table. At the end of the script, do this:

STORE Product INTO Product.qvd;

Then in your third combined QVW, load from the QVDs. Although I normally caution against LOAD *, in this case, the third application's script could be as simple as this:

[OrderItem]: LOAD * FROM OrderItem.qvd (QVD);
[Customer]: LOAD * FROM Customer.qvd (QVD);
[Product]: LOAD * FROM Product.qvd (QVD);

This approach should yield optimized QVD loads in your third QVW, which should go very quickly.