Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

where not in but with qvd files

Hi I am relatively new to Qlikview and coming from an SqlServer BI background. I am loading data into an document but now i need to filter out some data during the load, basically want all data from one table that is not in the other table. With sql I could do something like this:

SELECT AccountId, Email,Id

FROM Contact

where Id not in

(SELECT ContactId

FROM CampaignMember)

But now I have these two qvd files contact.qvd and campaignmember.qvd. So into the document I want to load all the data from contact that does have its ContactId in campaignmember.qvd .

Could anyone help me with this ?

Regards

Birkir

1 Solution

Accepted Solutions
JonnyPoole
Employee
Employee

Use the 'exists' function.  So first load the contacts from campaign members.

Then load the contacts where Id does not exist in the ContactId field from the pre-loaded campaign member table.

load

     ContactId

from <Campaignmember source> ;

Load

     AccountId,

     Email,

     Id

from <Contactsource>

where not exists(ContactId,Id) ;

View solution in original post

4 Replies
Anonymous
Not applicable
Author

look to "where not exists" in the QV help

JonnyPoole
Employee
Employee

Use the 'exists' function.  So first load the contacts from campaign members.

Then load the contacts where Id does not exist in the ContactId field from the pre-loaded campaign member table.

load

     ContactId

from <Campaignmember source> ;

Load

     AccountId,

     Email,

     Id

from <Contactsource>

where not exists(ContactId,Id) ;

Anonymous
Not applicable
Author

Hi,

Jonathan thank you so much for your help. This worked exactly as planned.

Regards

Birkir

JonnyPoole
Employee
Employee

Great to hear