Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

selvakumara
New Contributor III

Add two conditions

Hi ,

This is my expression.

Count(if(ACTIVE='YES',customers))

But I want to add [type]={'PAF'} add count . How can i do it ?

Count(if(ACTIVE='YES',Count({$<[type]={'PAF'}>} [customers])))  this one throwing error.

Thanks in advance    

7 Replies

Re: Add two conditions

Hi,

Try this.

Count({$<[type]={'PAF'},ACTIVE={'YES'}>} [customers])


Regards,

Kaushik Solanki

selvakumara
New Contributor III

Re: Add two conditions

tried but it doesn't give the exact count what i'm looking .

Thanks for your response

Thanks,

Selva

undergrinder
Valued Contributor II

Re: Add two conditions

Hi Selva,

With if try this:

=Count(if(ACTIVE='YES' and type= 'PAF',customers,null())


With set analysis is the answer, that kaushik.solanki‌ wrote. That expression should return the same with count+if.


G.



Highlighted
selvakumara
New Contributor III

Re: Add two conditions

Hi Gabor Tarnoczai,

Thanks for your response.

Count(if(ACTIVE='YES',customers)) this gives me -- 150   in the filter I've selected type (PAF). 


If I  use your expression


Count(if(ACTIVE='YES' and type= 'PAF',customers,null())  -- it gives more than 150 not even close


Thanks,

Selva




undergrinder
Valued Contributor II

Re: Add two conditions

It is strange.

What do you get, when the measure is =count(customer) and apply the two selections with filter pane?

The expressions and the filtered result should be the same.

G.

selvakumara
New Contributor III

Re: Add two conditions

Working Thanks for your help

undergrinder
Valued Contributor II

Re: Add two conditions

I hoped so