<?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 Running column summary question in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Running-column-summary-question/m-p/390533#M64069</link>
    <description>&lt;P&gt;I have 10+ year of daily records. All variables are binary (0/1).&amp;nbsp; However, I want to calculate on any given day what the sum of that&amp;nbsp; variable was the last 180 days.&amp;nbsp; So I would like to know what the sum was on January 1, 2021.&amp;nbsp; I also want to know what that is on January 2, 2021.&amp;nbsp; I know that 179 days are the same, but I want to have that calculated for every day.&amp;nbsp; What is the most efficient way to accomplish that?&amp;nbsp; Thank you.&lt;/P&gt;</description>
    <pubDate>Sat, 10 Jun 2023 23:31:09 GMT</pubDate>
    <dc:creator>chadyoder</dc:creator>
    <dc:date>2023-06-10T23:31:09Z</dc:date>
    <item>
      <title>Running column summary question</title>
      <link>https://community.jmp.com/t5/Discussions/Running-column-summary-question/m-p/390533#M64069</link>
      <description>&lt;P&gt;I have 10+ year of daily records. All variables are binary (0/1).&amp;nbsp; However, I want to calculate on any given day what the sum of that&amp;nbsp; variable was the last 180 days.&amp;nbsp; So I would like to know what the sum was on January 1, 2021.&amp;nbsp; I also want to know what that is on January 2, 2021.&amp;nbsp; I know that 179 days are the same, but I want to have that calculated for every day.&amp;nbsp; What is the most efficient way to accomplish that?&amp;nbsp; Thank you.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:31:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Running-column-summary-question/m-p/390533#M64069</guid>
      <dc:creator>chadyoder</dc:creator>
      <dc:date>2023-06-10T23:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: Running column summary question</title>
      <link>https://community.jmp.com/t5/Discussions/Running-column-summary-question/m-p/390545#M64070</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you don't mind creating an additional column, this will work and should be efficient: once the cumulative sum is computed, each cell is simply the difference of 2 cells in the cumulative sum column. You can accomplish the same thing (keeping the same efficiencies) with a self-referencing column formula and a conditional to handle the first 179 rows, but this is much more straightforward and should perform similarly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) Right-click on the column and select New Formula Column &amp;gt; Row &amp;gt; Cumulative Sum as in the image below.&lt;/P&gt;
&lt;P&gt;2) Rename this column something short, like Cusum, for convenience in step 3.&lt;/P&gt;
&lt;P&gt;3) Add a new column with this formula:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;:cusum - Lag( :cusum, 180 )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Brady&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="brady_brady_0-1622827422380.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/33279iC6BA3AAAE844158D/image-size/large?v=v2&amp;amp;px=999" role="button" title="brady_brady_0-1622827422380.png" alt="brady_brady_0-1622827422380.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jun 2021 17:31:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Running-column-summary-question/m-p/390545#M64070</guid>
      <dc:creator>brady_brady</dc:creator>
      <dc:date>2021-06-04T17:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: Running column summary question</title>
      <link>https://community.jmp.com/t5/Discussions/Running-column-summary-question/m-p/390616#M64076</link>
      <description>&lt;P&gt;Here is another way to do this. This way does not require the intermediate column. I'm not sure which of the 2 methods I describe is more efficient... either one should perform decently.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The idea behind this one is to find an equally-weighted (that is what the 1 in the formula does) moving average of 180 terms (i.e., the current term and the 179 previous), then multiply by 180 to get the moving sum.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Brady&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;180 * Col Moving Average( :Values, 1, 179 )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jun 2021 19:21:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Running-column-summary-question/m-p/390616#M64076</guid>
      <dc:creator>brady_brady</dc:creator>
      <dc:date>2021-06-04T19:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: Running column summary question</title>
      <link>https://community.jmp.com/t5/Discussions/Running-column-summary-question/m-p/390647#M64080</link>
      <description>&lt;P&gt;Thank you.&amp;nbsp; Both work&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jun 2021 19:58:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Running-column-summary-question/m-p/390647#M64080</guid>
      <dc:creator>chadyoder</dc:creator>
      <dc:date>2021-06-04T19:58:47Z</dc:date>
    </item>
  </channel>
</rss>

