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: 
Master II
Master II

Where to use where exists operation?

Where to use where exists operation? I am confusing with this.

Please help to provide the answer with an simple example.

I tried user manual but did not understand.

Thanks in advance.

EMP:

LOAD EMPNO,

     ENAME,

     JOB,

     MGR,

     HIREDATE,

     SAL,

     COMM,

     DEPTNO

FROM

EMP.qvd(qvd)

Where Exists(DEPTNO,10); // 1

//where exists(DEPTNO, DEPTNO);// 2

1 Solution

Accepted Solutions
Creator III
Creator III

5 Replies
Creator III
Creator III

Typically you would use the Where clause to limit the Load to specific records such as in you example you only wanted to load DEPTNO that was equal to 10.  So in that example you would simple write "Where DEPTNO = 10;".


However,  say you have already loaded a Dimension table that contains 25 different department i.e: 1 - 25. Instead of writing "Where DEPTNO = 1 and DEPTNO = 2 and DEPTNO = 3 etc.." you can simple write Where Exists(DEPTNO) and Qlikview will look to the already loaded tables and load only those DEPTNO that exist. .

Specialist II
Specialist II

Loads only data from Emp.QVD where the field DEPTNO = 10 in a previous loaded table

The line '...exists(DEPTNO, DEPTNO)'  returns a true (-1) if the value of the field DEPTNO in the current record already exists in any previously read record containing that field

Not applicable

hi,

  1. EMP: 
  2. LOAD EMPNO, 
  3.      ENAME, 
  4.      JOB, 
  5.      MGR, 
  6.      HIREDATE, 
  7.      SAL, 
  8.      COMM, 
  9.      DEPTNO 
  10. FROM 
  11. EMP.qvd(qvd)  where exists(DEPTNO, DEPTNO);

  12. u can also use -where exists(DEPTNO);

Regards

Vimlesh

Creator III
Creator III

Master II
Master II

Thank you sagarkharpude and all