Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!
Hi,
try changing the left join by a join
rgds
finally i have it using:
resident Users where not exists(ProductDate, UserCod);
Thanks!