Qlik Community

Ask a Question

New to QlikView

If you’re new to QlikView, start with this Discussion Board and get up-to-speed quickly.

Announcements
Welcome to our newly redesigned Qlik Community! Read our blog to learn about all the new updates: READ BLOG and REPORTED ISSUES
cancel
Showing results for 
Search instead for 
Did you mean: 
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
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
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

MVP & Luminary
MVP & Luminary

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