Choose Language Hide Translation Bar
Community Trekker

## Count of records with specific values

Hi,

I am working on a project where I have ID and attendance indicator for each ID (0 - Attended, 2 - Non - Attendance). I need to calculate the cumulative non - attendance rate as shown below. I need to know cumulative count of Non - attendance and divide by total count of that ID. This needs to be calculated on cumulative basis.

Appreciate if anyone can help me with a formula / script to accomplish this.  Thanks in advance.

 ID Attendance Indicator No - Show rate X_1 0 0% X_1 0 0% X_1 2 33% X_1 0 25% X_2 2 100% X_2 0 50% X_3 0 0% X_3 2 50% X_3 2 66%
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User

## Re: Count of records with specific values

Here is a formula that will do what you want

``````Col Cumulative Sum( If( :Attendance indicator == 2, 1, 0 ), :ID ) /
Col Cumulative Sum( 1, :ID )``````
Jim
2 REPLIES 2
Highlighted
Super User

## Re: Count of records with specific values

Here is a formula that will do what you want

``````Col Cumulative Sum( If( :Attendance indicator == 2, 1, 0 ), :ID ) /
Col Cumulative Sum( 1, :ID )``````
Jim
Highlighted
Community Trekker

## Re: Count of records with specific values

Thanks Jim for answering all my queries. You have been very helpful.