Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Partner
Partner

Where Condition from another QVD

Hi Guys,

My current script in the data load editor looks like this

LOAD * FROM [lib://QVD/Loans.QVD] (qvd) ;

.

.

.

.

LOAD * FROM [lib://QVD/Product.QVD] (qvd) ;

What i want to do is add a where condition in my products data to load only the products present in Loans .. These two are linked by "Product" column and this logic can be achieved like this


Load * from Product

where Product in (Select Product from Loans)



How can i do this in my QVD script?

1 Solution

Accepted Solutions
Highlighted
Specialist III
Specialist III

Hi,

LOAD * FROM [lib://QVD/Loans.QVD] (qvd) ;

LOAD * FROM [lib://QVD/Product.QVD] (qvd)

Where Exists(Product );


but make sure to load Product table after Loans table.



View solution in original post

8 Replies
Highlighted
Contributor III
Contributor III

  1. Load the full qvd file,
  2. use resident and drop the qvd table
Highlighted
Partner
Partner

Hi Hari, I did so but i was unable to get what i wanted. Can you elaborate with the script please

Highlighted
Specialist III
Specialist III

Hi,

Use

Where Exists(Product );



Highlighted
Specialist III
Specialist III

Hi,

LOAD * FROM [lib://QVD/Loans.QVD] (qvd) ;

LOAD * FROM [lib://QVD/Product.QVD] (qvd)

Where Exists(Product );


but make sure to load Product table after Loans table.



View solution in original post

Highlighted
Partner
Partner

try sthing like this:

Loans:

LOAD ..., Product as ProductLoan FROM [lib://QVD/Loans.QVD] (qvd) ;

Products:

LOAD * FROM [lib://QVD/Product.QVD] (qvd) ;

Final:

Load Product as ProductLoan , Address Resident Products where Exists (ProductLoan, Product );

Drop Tables Loans, Products;

Highlighted
Partner
Partner

Thanks for the quick reply this worked

Highlighted
Contributor III
Contributor III

Loans: LOAD * FROM [lib://QVD/Loans.QVD] (qvd) ;

Product_Loan_Mapping: Mapping Load Product, 'Mapped' as Flag resident Loans;

Product_Temp:

Load *, ApplyMap('Product_Loan_Mapping', Prodcut, 'N/A') As Mappings;

LOAD * FROM [lib://QVD/Product.QVD] (qvd) ;


NoConcatenate

Product:

Load * resident Product_Temp where Product = "Mapped";

Highlighted
Contributor III
Contributor III

Drop table Product_Temp;