Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
its_rajvir
Creator
Creator

Where not exists

Dear Experts,

 

I wanted to extract the data that not exists in other table. I am using this SQL Script:

Select a.ID
,a.LocId as StartLoc
,a.Date as BeginTime
from source as a
where a.Type = 'I'
a.Date between 'date1' and 'date2'
and a.LocId = 54
and not exists
(select * from source as c
where a.ID = C.ID
and where c.Type in ('O')
and a.Date < c.Date
and c.Date between 'date1' and 'date2')

i don't know how to create the same logic in qlik script i am not understanding how to do the not exist part.

Please help!

 

Thanks in advance

Labels (4)
1 Reply
Bunim
Contributor III
Contributor III

Table1:
select * from source 
where Type in ('O')
and Date between 'date1' and 'date2');

 

 

Table2:
Load * where not exists(ID);
Select
 
ID

,LocId as StartLoc
,Date as BeginTime
from source 
where Type = 'I'
Date between 'date1' and 'date2'
and LocId = 54;