<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Cumulative Summation by Group in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Cumulative-Summation-by-Group/m-p/513#M513</link>
    <description>I am trying to do a Cumulative Summation by a group value in another column, and so far nothing I have tried (For, While, double Summation) has worked.   I can do a cumulative sum for the entire table with:&lt;BR /&gt;&lt;BR /&gt;Summation( ::i = 1, Row(), :Total WIP[::i, Empty()] )&lt;BR /&gt;&lt;BR /&gt;However, I need to do a separate cumulative sum for each "segment" I have in another column (i.e. I need a cumulative sum where :seg==1, and then a separate one where :seg==2, however I can't get the index to re-set itself when the seg value changes)&lt;BR /&gt;&lt;BR /&gt;Any help would be greatly appreciated.</description>
    <pubDate>Wed, 10 Jun 2009 16:00:13 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-06-10T16:00:13Z</dc:date>
    <item>
      <title>Cumulative Summation by Group</title>
      <link>https://community.jmp.com/t5/Discussions/Cumulative-Summation-by-Group/m-p/513#M513</link>
      <description>I am trying to do a Cumulative Summation by a group value in another column, and so far nothing I have tried (For, While, double Summation) has worked.   I can do a cumulative sum for the entire table with:&lt;BR /&gt;&lt;BR /&gt;Summation( ::i = 1, Row(), :Total WIP[::i, Empty()] )&lt;BR /&gt;&lt;BR /&gt;However, I need to do a separate cumulative sum for each "segment" I have in another column (i.e. I need a cumulative sum where :seg==1, and then a separate one where :seg==2, however I can't get the index to re-set itself when the seg value changes)&lt;BR /&gt;&lt;BR /&gt;Any help would be greatly appreciated.</description>
      <pubDate>Wed, 10 Jun 2009 16:00:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Cumulative-Summation-by-Group/m-p/513#M513</guid>
      <dc:creator />
      <dc:date>2009-06-10T16:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Summation by Group</title>
      <link>https://community.jmp.com/t5/Discussions/Cumulative-Summation-by-Group/m-p/514#M514</link>
      <description>There is an easy way to do it.  Let me explain my data table first:&lt;BR /&gt;&lt;BR /&gt;-There is a column specifying the group, called "Seg".&lt;BR /&gt;-There is the data column, called "Y".&lt;BR /&gt;-The column containing the cumulative sum formula is called "Cum Sum".&lt;BR /&gt;&lt;BR /&gt;The formula in the Cum Sum column is:&lt;BR /&gt;&lt;BR /&gt;If( Row() == 1, :Y,&lt;BR /&gt;  :Seg[Row()] == :Seg[Row() - 1], :Cum Sum[Row() - 1] + :Y[Row()],&lt;BR /&gt;  :Seg[Row()] != :Seg[Row() - 1], :Y[Row()]&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;This formula only works if the data table is sorted by seg, and the Y column is in the order you want.</description>
      <pubDate>Wed, 10 Jun 2009 17:09:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Cumulative-Summation-by-Group/m-p/514#M514</guid>
      <dc:creator />
      <dc:date>2009-06-10T17:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Summation by Group</title>
      <link>https://community.jmp.com/t5/Discussions/Cumulative-Summation-by-Group/m-p/515#M515</link>
      <description>Hi Jonathan,&lt;BR /&gt;&lt;BR /&gt;Thank you, that gets me a whole lot closer, and while it does partially re-set where Seg changes, the cumulative sum itself doesn't reset still?&lt;BR /&gt;&lt;BR /&gt;My table is sorted by Seg and the Y column (Total WIP) is in the order I want it in.&lt;BR /&gt;&lt;BR /&gt;If(&lt;BR /&gt;	Row() == 1, :Total WIP,&lt;BR /&gt;	:Seg[Row()] == :Seg[Row() - 1],&lt;BR /&gt;		:Cum Sum[Row() - 1] + :Total WIP[Row()],&lt;BR /&gt;	:Seg[Row()] != :Seg[Row() - 1], :Total WIP[Row()]&lt;BR /&gt;)</description>
      <pubDate>Wed, 10 Jun 2009 18:06:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Cumulative-Summation-by-Group/m-p/515#M515</guid>
      <dc:creator />
      <dc:date>2009-06-10T18:06:24Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Summation by Group</title>
      <link>https://community.jmp.com/t5/Discussions/Cumulative-Summation-by-Group/m-p/516#M516</link>
      <description>I'm glad the example helped you a little.  But, I am confused as to what you are trying to do.  The example I provided does indeed do the cumulative sum, with the cumulative sum reseting when the grouping changes.  I thought that is what you wanted to do.  Please describe in more detail what you want to accomplish.</description>
      <pubDate>Mon, 22 Jun 2009 17:12:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Cumulative-Summation-by-Group/m-p/516#M516</guid>
      <dc:creator />
      <dc:date>2009-06-22T17:12:20Z</dc:date>
    </item>
  </channel>
</rss>

