5 Replies Latest reply: Apr 18, 2017 12:49 PM by omar bensalem

# Help with COUNT of FIELD equal to specific value

Here's what I'm hoping to display in KPI: Count({[Priority] = '3 - Medium'})

Field is "Priority" and wanting to count number of times it's equal to "3 - Medium"

I know this is so easy for you folks - hoping someone can clarify this for me.  I'm just starting out (as you can tell)...

• ###### Re: Help with COUNT of FIELD equal to specific value

Try

or for both

• ###### Re: Help with COUNT of FIELD equal to specific value

Try like:

Count({<[Priority] = {'3 - Medium'}>} [Priority] )

• ###### Re: Help with COUNT of FIELD equal to specific value

Hi Wes,

Count(Priority) is the original expression.

Now we do not want to count all that exists in Priority, but only certain values.

To do that we add our condition in a set expression:

1) first step: we  automatically add this (it's a syntax thing):

Count({<>}Priority)

2) Now we will put our condition within it: the [Priority] = '3 - Medium' thing:

Count({<Priority={}>}Priority)

3)Now, depends on the condition, we might add quotes or double quotes;

-Let me explain; if we were working with field Year, and we want to just work with Year 2017, since it's a numeric value:

Year={2017} without quotes

-If we work with a string, let's say country = Tunisia , we surround it with quotes:

Country={'Tunisia'}

-If it's an expression (the max year for example), we surround it by double quotes:

Year= {"max(Year)"}

Now, since it's a calculation; (the max), it's demands a '='; and the '=' demands a '\$' sign to return the outcome of the calculation:

Year= {"\$(=max(Year))"}

Now, in our case, we work with a string; so our expression will be

from;

Count({<Priority={}>}Priority)

To:

Count({<Priority={'3-Medium'}>}Priority)

Hope that was rather clear

• ###### Re: Help with COUNT of FIELD equal to specific value

Thanks all for the great guidance!  This was exactly what I needed.