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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Know if exists and if not exists

Hi, i need a dimension (IsPurchased) where know if a User has or not date of purchase of the Product called AC, but i can get both of them. With the script i'm using only get when has not date.

Users:
Load cod as UserCod,
trim(name) & ' ' & trim(surname) as FullName
SQL SELECT cod, name, surname FROM userdat;

left join (Users)

LOAD usercod as UserCod,
type as TypeCod,
pdate as ProductDate
where type='AC';
SQL SELECT type, pdate, usercod FROM UProducts;

ProductsUsers:
LOAD
*,
if(isnull(ProductDate),'NO','YES') as IsPurchased
resident Userswhere not exists(ProductDate);

drop table Users;

Thanks!

2 Replies
hector
Specialist
Specialist

Hi,

try changing the left join by a join

rgds

Not applicable
Author

finally i have it using:

resident Users where not exists(ProductDate, UserCod);

Thanks!