- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Count of records with specific values
Thanks Jim for answering all my queries. You have been very helpful.