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

- JMP User Community
- :
- Discussions
- :
- Rolling cumulative sum by groups of column entries

- 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

Aug 6, 2019 2:08 PM
(551 views)

Hi,

I am trying to create the cumulative sum column as shown in the table below.

When I use the Col cumulative sum( value) directly, it gives cumulative sum for entire value column. Can anyone please help me understand how to calculate the cumulative sum for groups of Type as shown in table below?

Name | Type | value | cumulative sum |

AAA | T1 | 1 | 1 |

AAA | T1 | 10 | 11 |

AAA | T1 | 32 | 43 |

AAA | T1 | 4 | 47 |

AAA | T2 | 2 | 2 |

AAA | T2 | 3 | 5 |

AAA | T2 | 5 | 10 |

AAA | T2 | 6 | 16 |

BBB | T1 | 32 | 32 |

BBB | T1 | 34 | 66 |

BBB | T1 | 5 | 71 |

BBB | T1 | 67 | 138 |

BBB | T2 | 34 | 34 |

BBB | T2 | 32 | 66 |

BBB | T2 | 7 | 73 |

BBB | T2 | 8 | 81 |

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

Use the by capability within the Col Cumulative Sum() function.

`col cumulative sum(:value, :Name, :Type);`

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

Use the by capability within the Col Cumulative Sum() function.

`col cumulative sum(:value, :Name, :Type);`

Jim

Highlighted
##

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

Re: Rolling cumulative sum by groups of column entries

Thank you for quick and precise answer :)

Article Labels

There are no labels assigned to this post.