10 Replies Latest reply: Mar 13, 2016 9:19 PM by Saran De

# how can i put if, then count in the one expression?

Hi ,

I want to achieve the following but am not having any luck.  Any help appreciated:-

I want to count(green) all accountNo. or lines where the Member = 'Yes', and the AccountNo and productClassifation are the same.

 Count 4 AccountNo AccountName Member ProductNumber ProductClassification 2500 Red Sox Yes 503650 RedBox 2500 Lost and Found Yes 502144 Glass 2750 Blue Bears No 502014 RedBike 2700 Green Toads Yes 502260 RedDoor 2700 Green Toads Yes 502874 RedDoor

I'm trying :-

=if(IsMember='Yes',count(DISTINCT[AccountNo]&[AccountName]&[ProductClassificationSummary]) )

• ###### Re: how can i put if, then count in the one expression?

I don't understand your second condition, but may be this:

Count(DISTINCT {<Member = {'Yes'}>} [AccountNo]&[AccountName]&[ProductClassificationSummary])

• ###### Re: how can i put if, then count in the one expression?

Thanks Sunny.

I.e. I need to add if Product='Active'

• ###### Re: how can i put if, then count in the one expression?

{<Member = {'Yes'}, Product = {'Active'}>}

• ###### Re: how can i put if, then count in the one expression?

Thanks Sunny

• ###### Re: how can i put if, then count in the one expression?

No problem at all

• ###### Re: how can i put if, then count in the one expression?

Hi Sunny,

if i need to use "and" to make sure both parameters are met ,  how can i do this?  i tried using and, then & without success.

Cheers

• ###### Re: how can i put if, then count in the one expression?

The comma separated list within a single set analysis usually works like an 'AND'. Is it not giving you the right output?

• ###### Re: how can i put if, then count in the one expression?

no.  hey,  how do i exclude the title from being included in the count.  i've added one but that stuffs up the formula when i select one account to look at.

• ###### Re: how can i put if, then count in the one expression?

HI,

Try like this

Count(If(IsMember='Yes' OR AccountName LIKE '*Green*', AccountNo))

Regards,

jagan.

• ###### Re: how can i put if, then count in the one expression?

Hi Jagan,

Thanks for this information. I was not aware before that we can use LIKE in IF. I had many places of such, where I was using MATCH or WILDMATCH before.