Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

demlet123
New Contributor III

Exclude values from table?

I have been trying multiple ways to exclude demo users from all users -  joining, using where UserID<>USER_ID, etc. I also tried this method below from another post, with no luck. I put the select statements before the loads and it ran, but then the PEOPLE_ID wouldn't return for All_Users.... this is so simple in normal SQL.


How do I fix this? Thanks.


Demo_Users:

LOAD

USER_ID AS D.USER_ID;

SELECT

"USER_ID"

FROM "DEMO_USERS";

All_Users:

LOAD

PEOPLE_ID,

USER_ID AS A.USER_ID

WHERE NOT EXISTS(D.USER_ID,A.USER_ID);

SELECT

"USER_ID",

"PEOPLE_ID"

FROM "All_Users";


DROP TABLE Demo_Users;

Tags (1)
6 Replies

Re: Exclude values from table?

Change WHERE NOT EXISTS(D.USER_ID,A.USER_ID); to WHERE NOT EXISTS(D.USER_ID,USER_ID);



talk is cheap, supply exceeds demand
YoussefBelloum
Esteemed Contributor

Re: Exclude values from table?

Hi,

this line is wrong:

WHERE NOT EXISTS(D.USER_ID,A.USER_ID);


replace it to this:


WHERE NOT EXISTS(D.USER_ID,USER_ID);

demlet123
New Contributor III

Re: Exclude values from table?

Thanks for the quick replies Youssef, and Gysbert! This worked.

I would like to apologize for the duplicate posts (not intentional), which I deleted. There seems to be some lag in the site. I posted the discussion but it never showed as posted. I went to re-post and it had a "recover" option, so I recovered and posted it. Also when I click on the discussion, none of your replies are visible. I can only see the replies in the feed...

Thanks again!

demlet123
New Contributor III

Re: Exclude values from table?

Hi Gysbert,

This ran with no errors, but the All_Users table is showing zero values for both PEOPLE_ID & A.USER_ID.

I can confirm that there are only 13 D.USER_ID's, and there are thousands of A.USER_ID's.

Any idea what may be happening here? Thanks in advance.

Re: Exclude values from table?

Is there another table already loaded that also has a field D.USER_ID?


talk is cheap, supply exceeds demand
demlet123
New Contributor III

Re: Exclude values from table?

There are no other tables with D.USER_ID. Thanks

Community Browser