Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikviewwizard
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
sagarkharpude
Creator III
Creator III

5 Replies
Anonymous
Not applicable

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. .

danieloberbilli
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

sagarkharpude
Creator III
Creator III

PFA

qlikviewwizard
Master II
Master II
Author

Thank you sagarkharpude and all