<?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: How to script the difference between time stamp in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-script-the-difference-between-time-stamp/m-p/62522#M33707</link>
    <description>&lt;P&gt;Given the specifics you supplied, I think this might be a good solution for you&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt2:ReadTime &amp;lt;&amp;lt; Data Type( Numeric ) &amp;lt;&amp;lt; Set Modeling Type( Continuous )
 &amp;lt;&amp;lt; Format( "yyyy-mm-ddThh:mm:ss", 19 );
dt2 &amp;lt;&amp;lt; New Column( "Missing Data?",
	character,
	formula(
		If( Date Difference( Lag( :ReadTime ), :ReadTime, "Minute" ) &amp;gt; 5,
			"Missing Data",
			"No Missing Data"
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 11 Jul 2018 13:50:48 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2018-07-11T13:50:48Z</dc:date>
    <item>
      <title>How to script the difference between time stamp</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-script-the-difference-between-time-stamp/m-p/62437#M33669</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working on a script that checks the missing data for users. We record data every 5 minutes. If the difference between 2&amp;nbsp;timestamps is larger than 5 minutes we define that there is missing&amp;nbsp;data for that period of time.&amp;nbsp;And the format of the time in my data table&amp;nbsp;looks like this:&lt;/P&gt;&lt;P&gt;2018-07-09 00:58:07.7030000&lt;/P&gt;&lt;P&gt;2018-07-09 00:58:07.7030000&lt;/P&gt;&lt;P&gt;2018-07-09 00:58:07.7030000&lt;/P&gt;&lt;P&gt;Does anyone know how should I script&amp;nbsp;to select the cell that has more than 5 minutes timestamps?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot,&lt;/P&gt;&lt;P&gt;Winnie&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jul 2018 20:34:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-script-the-difference-between-time-stamp/m-p/62437#M33669</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-07-10T20:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to script the difference between time stamp</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-script-the-difference-between-time-stamp/m-p/62439#M33671</link>
      <description>&lt;P&gt;It appears that your date column is not a numeric, JMP Date/Time value.&amp;nbsp; It appears that it is a character column.&amp;nbsp; So the first thing you need to do is to convert it into a JMP Date/Time column.&amp;nbsp; Once that is done, the way to check to see if the difference between values, is to use the Date Difference() function in conjunction with a Lag() Function.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If(Date Difference( lag(:DateTime),:DateTime,"Minute)&amp;gt;5,dataGood="Missing Data",dataGood="No Missing Data");&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Jul 2018 20:56:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-script-the-difference-between-time-stamp/m-p/62439#M33671</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-07-10T20:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to script the difference between time stamp</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-script-the-difference-between-time-stamp/m-p/62521#M33706</link>
      <description>&lt;P&gt;Hi Jim,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you so much for your reply. I have made changes based on your suggestion. My script is showing below:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt2:ReadTime &amp;lt;&amp;lt; Data Type( Numeric ) &amp;lt;&amp;lt; Set Modeling Type( Continuous ) &amp;lt;&amp;lt; Format( "yyyy-mm-ddThh:mm:ss", 19 );
If( Date Difference( Lag( :ReadTime ), :ReadTime, "mm" ) &amp;gt; 5,
	dataGood = "Missing Data",
	dataGood = "No Missing Data"
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The data type and format have been changed successfully, however, I am confused about&amp;nbsp;how to check dataGood. Do I need to create a new column for dataGood?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 13:56:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-script-the-difference-between-time-stamp/m-p/62521#M33706</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-07-11T13:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to script the difference between time stamp</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-script-the-difference-between-time-stamp/m-p/62522#M33707</link>
      <description>&lt;P&gt;Given the specifics you supplied, I think this might be a good solution for you&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt2:ReadTime &amp;lt;&amp;lt; Data Type( Numeric ) &amp;lt;&amp;lt; Set Modeling Type( Continuous )
 &amp;lt;&amp;lt; Format( "yyyy-mm-ddThh:mm:ss", 19 );
dt2 &amp;lt;&amp;lt; New Column( "Missing Data?",
	character,
	formula(
		If( Date Difference( Lag( :ReadTime ), :ReadTime, "Minute" ) &amp;gt; 5,
			"Missing Data",
			"No Missing Data"
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Jul 2018 13:50:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-script-the-difference-between-time-stamp/m-p/62522#M33707</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-07-11T13:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to script the difference between time stamp</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-script-the-difference-between-time-stamp/m-p/62523#M33708</link>
      <description>&lt;P&gt;Hi Jim, I have figured out the issues. Thank you so much again!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 13:54:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-script-the-difference-between-time-stamp/m-p/62523#M33708</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-07-11T13:54:30Z</dc:date>
    </item>
  </channel>
</rss>

