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

Announcements
April 13–15 - Dare to Unleash a New Professional You at Qlik Connect 2026: Register Now!
cancel
Showing results for 
Search instead for 
Did you mean: 
rahulsingh12
Contributor III
Contributor III

Not Exists

Hi

I have a table with two ID columns Primary_ID and FK_ID.

The Primary_ID contains the  FK_ID also ,so while loading the scipt I want the PrimaryID which are not the FK_ID .

How can I do it at a script level while loading the data.

Is there anything like not exist for script level restriction.

Regards,

14 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Exists() really is a script level restriction, nothing else.

But your requirement is a bit weird. You say that Primary_ID contains FK_ID, but next you want to load all rows where Primary_ID <> FK_ID... Isn't that a bit contradictory?

rahulsingh12
Contributor III
Contributor III
Author

Actually It is what the way the day has to be structured.

The Primary may contain FK id but we want only the one's which are not in FK.

Regards,

rahulsingh12
Contributor III
Contributor III
Author

any suggestion on how to go about it.

basically the table should contain Primary and FK both fields but Primary should not have FK values.

antoniotiman
Master III
Master III

May be

..... Where Not Exists(Primary,FK);

Regards,

Antonio

tresB
Champion III
Champion III

May be like:

Capture.PNG

Capture2.PNG

So in your case it would be like:

Load * <>  Where Not Exists( FK_ID,Primary_ID);       //Corrected the order

rahulsingh12
Contributor III
Contributor III
Author

this is not loading any data for me.

the record count is 0.

antoniotiman
Master III
Master III

You don't need 2nd LOAD Resident

Try

LOAD * from Table Where Not Exists(Primary,PK);

rahulsingh12
Contributor III
Contributor III
Author

I just loaded it once

Regards,

tresB
Champion III
Champion III

That actually depends. If you don't use second load, the values in first field that appears later in second field would be loaded and I assume OP doesn't want that.