Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

<> condition issue

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

1 Solution

Accepted Solutions
MVP
MVP

Re: <> condition issue

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)

7 Replies
MVP
MVP

Re: <> condition issue

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

Not applicable

Re: <> condition issue

Maybe: if(USERS_ALL.u_email <> SUBSCRIPTIONS_DISTINCT.email,count(distinct USERS_ALL.u_email))

Not applicable

Re: <> condition issue

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

(
qvd);

SUBSCRIPTIONS_DISTINCT:
LOAD email,
email as %Key_EMAIL,

FROM [..\QVD\SUBSCRIPTIONS.QVD] (qvd)
where is_subscribed = 1;

Thanks

gerardo

MVP
MVP

Re: <> condition issue

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)

Not applicable

Re: <> condition issue

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?

MVP
MVP

Re: <> condition issue

Just remove the minus sign (set expression exclusion operator)

=count(distinct {<u_email = p(email) > } u_email)

Not applicable

Re: <> condition issue

well, i thought the minus sign was a type error because the editor expresion underline it in red.....but im wrong, because the expresion is ok.

now, the values looks well....

thanks a lot....

gerardo

Community Browser