5 Replies Latest reply on Jan 15, 2016 4:27 AM by Derrick Austin

# Unable to get Correct Count

Hi All,

I am trying to do simple calculation but some how its not working. I have a column called [Case Time P1 8Hrs], it has 1's and 0's.

My Goal is  get percentage of 1's . Which is [(Count of 1s)/(Total count ie 0s + 1s)]*100

So first I try to get count of 1's by creating formula called [Count_1]

CASE(ATTR([Case Time P1 8Hrs])) WHEN 1

THEN

COUNT([Case Time P1 8Hrs])

END

then i just do [Count_1]/  COUNT([Case Time P1 8Hrs])

I get blanks. Actually my Count_1 is not getting calculated properly, not sure why. Kindly Advice!

PFA! Thanks a lot!

• ###### 1. Re: Unable to get Correct Count

Fauzia,

Checked your Data on the lowest level but not able to check the source-data.

Could you check what the notation/values are for example ALCATEL-LUCENT? For one entry the calc is ok but for 2 others is gives "blancs"

• ###### 2. Re: Unable to get Correct Count

Hey Fauzia,

If you have 1s and 0s in the field, couldn't you simply use "SUM([Case Time P1 8Hrs])" as the count of 1's?

Derrick Austin

• ###### 3. Re: Unable to get Correct Count

Hi Derrick,

It worked Thanks. I was wondering though if its different numbers other than 0's and 1's, how to do calculations?

Also shanks for sharing your Blog Link ,it has lot of useful info.

• ###### 4. Re: Unable to get Correct Count

Hi Norbert,

Apple has a count of 2 for 1's and 1 for 0 for the month of OCT-2015 and no values for ALCATEL LUCENT for Oct.

Yahoo Inc has Eight 1's and two 0's

I am  filtering by fiscal month Oct for simplification of testing.

• ###### 5. Re: Unable to get Correct Count

Hey Fauzia,

If you are looking for something besides a 1, say a "2", you could do some logic inside the SUM.

Something like this:

SUM(IF [Case Time P1 8Hrs] = 2 THEN 1 END)