Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

jananireddy
Contributor

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
mdmukramali
Valued Contributor II

Re: Where Condition from another QVD

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.



8 Replies
hariprasathr_cg
New Contributor III

Re: Where Condition from another QVD

  1. Load the full qvd file,
  2. use resident and drop the qvd table
jananireddy
Contributor

Re: Where Condition from another QVD

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

mdmukramali
Valued Contributor II

Re: Where Condition from another QVD

Hi,

Use

Where Exists(Product );



mdmukramali
Valued Contributor II

Re: Where Condition from another QVD

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.



OmarBenSalem
Esteemed Contributor

Re: Where Condition from another QVD

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;

jananireddy
Contributor

Re: Where Condition from another QVD

Thanks for the quick reply this worked

hariprasathr_cg
New Contributor III

Re: Where Condition from another QVD

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";

hariprasathr_cg
New Contributor III

Re: Where Condition from another QVD

Drop table Product_Temp;

Community Browser