Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
AccountNoAccountNameMemberProductNumberProductClassification
2500Red SoxYes503650RedBox
2500Lost and FoundYes502144Glass
2750Blue BearsNo502014RedBike
2700Green ToadsYes502260RedDoor
2700Green ToadsYes502874RedDoor

I'm trying :-

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

1 Solution

Accepted Solutions
sunny_talwar

Add all the filters in your set analysis:

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

View solution in original post

10 Replies
sunny_talwar

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

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

jagan
Luminary Alumni
Luminary Alumni

HI,

Try like this

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

Regards,

jagan.

Anonymous
Not applicable
Author

Thanks Sunny.

how do I keep adding parameters please.

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

sunny_talwar

Add all the filters in your set analysis:

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

Anonymous
Not applicable
Author

Thanks Sunny

sunny_talwar

No problem at all

Anonymous
Not applicable
Author

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

sunny_talwar

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

Anonymous
Not applicable
Author

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.