5 Replies Latest reply: May 9, 2014 4:30 AM by Lorenzo Topi

# count with a condition

Hello,

in the "expression" tab of a pivot table, I'd like to make a count only if a condition is true, like this:

CONDITION: [QUOTA PARTECIPAZIONE DIRETTA]>'0,0' and [QUOTA PARTECIPAZIONE DIRETTA]<='0,1'

EXPRESSION: count(DISTINCT [CODICE ISTAT ENTE PARTECIPANTE])

Where I go wrong?

Thanks.

Lorenzo

• ###### Re: count with a condition

1 as RowCount

Then you can use set analysis:

sum({<[QUOTA PARTECIPAZIONE DIRETTA]={">0"}>}      RowCount)

Regards

Richard

• ###### Re: count with a condition

Hi there,

Please check out the attached file. Its a slight variation to Richard's solution. I am using an If condition on the back-end to determine if its >0 (a Flag) so that on the front end you can just do Sum(Flag).

Hope it helps

Thanks

AJ

• ###### Re: count with a condition

condition on expression?

count(distinct if([QUOTA PARTECIPAZIONE DIRETTA]>0,  [CODICE ISTAT ENTE PARTECIPANTE]))

remove single quote

remove decimal or if you want it, I suppose you have to use .  not  , (comma)

• ###### Re: count with a condition

If([QUOTA PARTECIPAZIONE DIRETTA] <= 0 ,1) as QPD_Flag

From Location;

And then in expression use expression

Count(QPD_Flag)

• ###### Re: count with a condition

Thanks to all for your support