Skip to main content
Announcements
Qlik Community Office Hours - Bring your Ideation questions- May 15th, 11 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
prashant_pandya
Contributor
Contributor

How to use WHERE clause

Hello,

I am new to QlikView. I have few SQL tables and QVD's generated from it. I want to load only the specific records from the QVD's to the application using where condition SQL eg. Where department in (Select department from DD where status = 'active')

The challenge I am facing is - each QVD have millions of rows and not all rows are required into the new application - So do I need to specify where clause to all the QVD Load statements ? Can a condition (like department = 'Client Operations') once applied to the first load and then all subsequent load statements will only load the relevant records ?

Table1:

LOAD TYPE_CODE,

     TYPE_NAME,

  CATEGORY_NAME,

     SUBCATEGORY_NAME

FROM

REF_TYPE.qvd (qvd) WHERE TYPE_CODE = 'ABC'; 

Table2: 

LOAD SUMARY_ID,

  SA_ID,

   SA_LOD,

   TYPE_NAME,

  ...

FROM

SUMMARY.qvd (qvd);

Summary QVD has millions of records and only a subset of records are required.

Please advise.

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

Table2:

LOAD SUMARY_ID,

  SA_ID,

   SA_LOD,

   TYPE_NAME,

  ...

FROM

SUMMARY.qvd (qvd)

Where Exists (TYPE_NAME);

View solution in original post

2 Replies
MK_QSL
MVP
MVP

Table2:

LOAD SUMARY_ID,

  SA_ID,

   SA_LOD,

   TYPE_NAME,

  ...

FROM

SUMMARY.qvd (qvd)

Where Exists (TYPE_NAME);

Gysbert_Wassenaar

The where clause only applies to the load statement it is used in. If you want only related records from the other loads then you'll have to use Where Exists or Left Keep. It depends on the situation which will perform better. That's means you will have to test that on your particular files. See this discussion: Re: Left Keep vs Where Exists


talk is cheap, supply exceeds demand