Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
i have a problem with the condition <> in a count expression.
The expresion is this:
count(distinct(if(USERS_ALL.u_email <> SUBSCRIPTIONS_DISTINCT.email, USERS_ALL.u_email)))
and for example, in both tables there is a value like 'gerardo@hotmail.com' but i dont know why the last expression include this value.
What im doing wrong?
Thanks
gerardo
gerardo,
it seems to me that your tables are not linked, right?
So your embedded if() statement is implicitely building an embedded table containing all combinations of u_email and email. In you have more than one distinct email values, I guess your comparison will return all distinct u_email values.
I think something like this might solve your problem better:
=count(distinct {<USERS_ALL.u_email -= p(SUBSCRIPTIONS_DISTINCT.email) > } USERS_ALL.u_email)
gerardo,
could you tell us a bit more about the two tables and how they are linked? Would be best if you could post some sample lines of data.
Thanks,
Stefan
Maybe: if(USERS_ALL.u_email <> SUBSCRIPTIONS_DISTINCT.email,count(distinct USERS_ALL.u_email))
Hi Swuehl,
I send you more information about….hope this help to give me a hand….
USERS_ALL:
LOAD email as u_email,
id as %Key_USER_ID,
id as u_user_id
FROM
(
SUBSCRIPTIONS_DISTINCT:
LOAD email,
email as %Key_EMAIL,
FROM [..\QVD\SUBSCRIPTIONS.QVD] (qvd)
where is_subscribed = 1;
Thanks
gerardo
gerardo,
it seems to me that your tables are not linked, right?
So your embedded if() statement is implicitely building an embedded table containing all combinations of u_email and email. In you have more than one distinct email values, I guess your comparison will return all distinct u_email values.
I think something like this might solve your problem better:
=count(distinct {<USERS_ALL.u_email -= p(SUBSCRIPTIONS_DISTINCT.email) > } USERS_ALL.u_email)
thanks swuehl, so.....this count all emails in USERS_ALL table which are not present in SUBSCRIPTIONS_DISTINCT table? dont you?
and if i want to count all emails present in both tables?
Just remove the minus sign (set expression exclusion operator)
=count(distinct {<u_email = p(email) > } u_email)