Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Count of records with specific values

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jan 22, 2018 10:05 PM
(2221 views)

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

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
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Count of records with specific values

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