7 Replies Latest reply: Mar 19, 2014 11:06 AM by Michal Kwater

Build a count function with two conditions

Hello ,

Can anybody can build an expression - function count names with two conditions :

first          A - B > 0

second     'Is it subject'= Yes

Thanks

M

• Re: Build a count function with two conditions

The expression you are looking for is this:

Sum(If( Condition1 and Condition2, 1, 0)

is equivalemt to a count infact it sums 1 if both condition are satisfied

Hope it helps

• Re: Build a count function with two conditions

Thanks Alessandro,

I assumed It will be

Sum( If ( A - B > 0 and [Is it subject]= {Yes}, 1, 0)

but I am a new community member and I don't know where to put a 'name' which will be summed

• Re: Build a count function with two conditions

Sum( If ( (A - B) > 0 and [Is it subject]= {'Yes'}, 1, 0)

• Re: Build a count function with two conditions

If [Is it subject] is a field name and Yes is the value,

you can try to set the second condition as [Is it subject] = 'Yes'

so the final syntax would be:

Sum(If A-B >0 And [Is it subject] = 'Yes',1,0)

Good luck!

• Re: Build a count function with two conditions

I build a functions but is error in expression and it no use .

Sum( If ( ([A]-[B]) > 0 and [Is it subject]= {'YES'}, 1, 0))

Could be an issue that A = one value + second  and the same B (C+D)

Does anybody have any idea ?

• Re: Build a count function with two conditions

Maybe I didn't understand you well.

A, B and [Is it subject] are fields, right?

If so, I think this expression should work:

Sum(If(A-B>0 AND [Is it subject] = 'YES', 1, 0))

Let's see it it works

• Re: Build a count function with two conditions

Alex,

That's right  A, B  and [Is ... ] are fields