<?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 Re: Cumulative sum of time point data in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Cumulative-sum-of-time-point-data/m-p/413257#M66294</link>
    <description>&lt;P&gt;I opened the data table you attached, and found that my formula worked as I expected.&amp;nbsp; It created values of 0, 1, .....etc.&amp;nbsp; It also created negative binning values, since your times occurred on different dates, and some of the time values were before the starting time value.&amp;nbsp; i.e. 8:38:55 AM on 04/17/2021 has a value less than the time value of 12:55:03 PM on 04/16/2021.&amp;nbsp; Time values start every day at midnight as 0 seconds.&amp;nbsp; Also, I was generating just a binning number, not a time value.&amp;nbsp; Because you have data that spans more than one day, you need to use a JMP date/time value for the calculations, and for the binning value.&amp;nbsp; Attached is your data table with a new Bin Time, starting at 12:58 on April 16th, and increasing after that.&amp;nbsp; The formula does generate a bin value before your 12:58 starting time, so you will need to delete those rows.&lt;/P&gt;
&lt;P&gt;The formula is:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If( Row() == 1,
	start = Informat( "04/16/2021 12:58:00" )
);
Floor( ((:Date + :Time) - start) / In Minutes( 3 ) ) * In Minutes( 3 ) + start;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 27 Aug 2021 17:37:07 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2021-08-27T17:37:07Z</dc:date>
    <item>
      <title>Cumulative sum of time point data</title>
      <link>https://community.jmp.com/t5/Discussions/Cumulative-sum-of-time-point-data/m-p/412907#M66250</link>
      <description>&lt;P&gt;I am a low level user in JMP and trying to learn how to use it for time series data analysis.&amp;nbsp;&lt;BR /&gt;Currently, my data are collected in every 2 seconds, but how do I transform the data&amp;nbsp; to every 3 minutes into another column or table?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="fliew0410_0-1629996602441.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/35331i7FBEB59FA303580E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="fliew0410_0-1629996602441.png" alt="fliew0410_0-1629996602441.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:36:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Cumulative-sum-of-time-point-data/m-p/412907#M66250</guid>
      <dc:creator>fliew0410</dc:creator>
      <dc:date>2023-06-10T23:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative sum of time point data</title>
      <link>https://community.jmp.com/t5/Discussions/Cumulative-sum-of-time-point-data/m-p/413033#M66279</link>
      <description>&lt;P&gt;I assume that what you really want, is a new data table, where each row represents the mean of 3 minute intervals from the original data table.&lt;/P&gt;
&lt;P&gt;I would do it this way.&lt;/P&gt;
&lt;P&gt;Create a new column in the original data table.&amp;nbsp; Set the formula for the new column to&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;if(row()==1, start = :time);
floor((:time - start) / in minutes(3));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This will create a new column where the values are in 3 minute bins.&lt;/P&gt;
&lt;P&gt;Now all you need to do, is to use the Summary Platform&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Tables=&amp;gt;Summary&lt;/P&gt;
&lt;P&gt;to create the new data table.&amp;nbsp; Just specify your new bin column as the Group column and the means for the measurement columns.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 21:02:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Cumulative-sum-of-time-point-data/m-p/413033#M66279</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-08-26T21:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative sum of time point data</title>
      <link>https://community.jmp.com/t5/Discussions/Cumulative-sum-of-time-point-data/m-p/413208#M66291</link>
      <description>&lt;P&gt;Hi there, I tried the formula but the values shown are all 0 on the new column.&lt;/P&gt;&lt;P&gt;However, I used a similar concept creating a new bin column by rounding the original Time column (2 second interval, 1mL/2second measurement) to 3.33 minutes interval (100mL/200seconds measurement)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Round( :Time / (60 * 3.33) ) * (60 * 3.33)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then, I used your Tables &amp;gt; Summary suggestion to create a new data table, specifying my new bin column as Group and the sum of the measurement columns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems to work. But do you think this is just luck or this makes sense?&lt;/P&gt;</description>
      <pubDate>Fri, 27 Aug 2021 15:15:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Cumulative-sum-of-time-point-data/m-p/413208#M66291</guid>
      <dc:creator>fliew0410</dc:creator>
      <dc:date>2021-08-27T15:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative sum of time point data</title>
      <link>https://community.jmp.com/t5/Discussions/Cumulative-sum-of-time-point-data/m-p/413216#M66292</link>
      <description>&lt;P&gt;If you attach your data table, I will take a look at both your formula and figure out why my formula isn't giving you the results you want.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Aug 2021 16:16:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Cumulative-sum-of-time-point-data/m-p/413216#M66292</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-08-27T16:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative sum of time point data</title>
      <link>https://community.jmp.com/t5/Discussions/Cumulative-sum-of-time-point-data/m-p/413217#M66293</link>
      <description>&lt;P&gt;Sure. Please see attached.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now my problem with the formula I found is that my bin start with the first recorded time (from the original data table) rather than the time after 3 minutes. Ideally, I would like the time in the bin column to start with 12:58 (3 minutes after 12:55) and not 12:55.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Aug 2021 16:35:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Cumulative-sum-of-time-point-data/m-p/413217#M66293</guid>
      <dc:creator>fliew0410</dc:creator>
      <dc:date>2021-08-27T16:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative sum of time point data</title>
      <link>https://community.jmp.com/t5/Discussions/Cumulative-sum-of-time-point-data/m-p/413257#M66294</link>
      <description>&lt;P&gt;I opened the data table you attached, and found that my formula worked as I expected.&amp;nbsp; It created values of 0, 1, .....etc.&amp;nbsp; It also created negative binning values, since your times occurred on different dates, and some of the time values were before the starting time value.&amp;nbsp; i.e. 8:38:55 AM on 04/17/2021 has a value less than the time value of 12:55:03 PM on 04/16/2021.&amp;nbsp; Time values start every day at midnight as 0 seconds.&amp;nbsp; Also, I was generating just a binning number, not a time value.&amp;nbsp; Because you have data that spans more than one day, you need to use a JMP date/time value for the calculations, and for the binning value.&amp;nbsp; Attached is your data table with a new Bin Time, starting at 12:58 on April 16th, and increasing after that.&amp;nbsp; The formula does generate a bin value before your 12:58 starting time, so you will need to delete those rows.&lt;/P&gt;
&lt;P&gt;The formula is:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If( Row() == 1,
	start = Informat( "04/16/2021 12:58:00" )
);
Floor( ((:Date + :Time) - start) / In Minutes( 3 ) ) * In Minutes( 3 ) + start;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Aug 2021 17:37:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Cumulative-sum-of-time-point-data/m-p/413257#M66294</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-08-27T17:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative sum of time point data</title>
      <link>https://community.jmp.com/t5/Discussions/Cumulative-sum-of-time-point-data/m-p/413260#M66295</link>
      <description>&lt;P&gt;Thank you for the help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The answer is very close. I changed the start time to 12:55:00 as the time that the first data pointed is collected on the table, and I also edited the floor to ceiling so that the new bin column will show time greater than 12:55 only (12:58 as that is the time 3 minutes after 12:55). Then, the summary on new data table. Voila, the table looks like the one we wanted.&lt;/P&gt;&lt;P&gt;I am still learning from the scripting index but from a closer to perfect answer that you have provided, it is easier for me to understand. Thank you very much for that!&lt;/P&gt;</description>
      <pubDate>Fri, 27 Aug 2021 17:59:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Cumulative-sum-of-time-point-data/m-p/413260#M66295</guid>
      <dc:creator>fliew0410</dc:creator>
      <dc:date>2021-08-27T17:59:49Z</dc:date>
    </item>
  </channel>
</rss>

