Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

lauracastagna
Contributor

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

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

Add all the filters in your set analysis:

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

10 Replies

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])

MVP
MVP

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.

lauracastagna
Contributor

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

Thanks Sunny.

how do I keep adding parameters please.

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

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

Add all the filters in your set analysis:

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

lauracastagna
Contributor

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

lauracastagna
Contributor

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?

lauracastagna
Contributor

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.

Community Browser