1 Reply Latest reply on Jan 24, 2014 11:18 AM by Jim Wahl

# COUNT IF and %

Hi,

I am attempting to create a calculation using the following expression

COUNT(IF([Field1 Value ] =0 THEN COUNT[Field1 Value ]1))/COUNT(1) END

If keep getting the error "Expected closing parenthesis for the expression starting at character 9"

I've tried adding closing ')' in multiple places but just keep getting different versions of the same error.

My goal is to count the # of records where 'Field1 Value' = 0 then divide that by the total records in 'Field1 Value' with non-null values to get a % of records that = 0 against the total.

Next, I will create similar calcs for 'Field1 Value' between 1 and 3, then 'Field1 Value' >3, etc.

Toni

• ###### 1. Re: COUNT IF and %

The best way to approach this depends on your the level of detail in your data, how you want to handle duplicates, and what else you're trying to show in your view.

It could be very easy. If you're doing the countif at the individual row level, you could just use:

SUM(IIF([Field 1 Value]==0, 1, 0)) / SUM([Number of Records])