<?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: Merging time series with timestamp and duration in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Merging-time-series-with-timestamp-and-duration/m-p/222400#M44375</link>
    <description>&lt;P&gt;Thanks. Following this path, I would require a match of columns, but the time formats in the two tables differ: One is an unusual time stamp including milliseconds (hh:mm:ss:sss), the other a duration value in seconds (the duration starts at a certain time stamp, i.e. event).&lt;/P&gt;&lt;P&gt;My goal is to integrate a column with time stamps for every duration value. I would like to avoid rounding the duration values to milliseconds, since this would reduce the data integrity, but I'm not sure how to handle odd time stamp formats that include microseconds. If you have any suggestions, I would be very grateful.&lt;/P&gt;</description>
    <pubDate>Tue, 20 Aug 2019 15:07:49 GMT</pubDate>
    <dc:creator>WHG</dc:creator>
    <dc:date>2019-08-20T15:07:49Z</dc:date>
    <item>
      <title>Merging time series with timestamp and duration</title>
      <link>https://community.jmp.com/t5/Discussions/Merging-time-series-with-timestamp-and-duration/m-p/222179#M44333</link>
      <description>&lt;P&gt;I would like to merge the following tables 1 (time series with certain events, ~2000 datapoints) and 2 (time series with duration and amplitude data, ~1,000,000 datapoints) into a table like 3:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;timestamp&lt;/TD&gt;&lt;TD&gt;event&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20:23:56:962&lt;/TD&gt;&lt;TD&gt;A event&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20:24:14:964&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;B event&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;...&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;time [s]&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;amplitude&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;-0.000457764&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0.0000625&lt;/TD&gt;&lt;TD&gt;0.0642700195&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;timestamp&lt;/TD&gt;&lt;TD&gt;time [s]&lt;/TD&gt;&lt;TD&gt;event&lt;/TD&gt;&lt;TD&gt;amplitude&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20:23:56:962&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;A event&lt;/TD&gt;&lt;TD&gt;-0.000457764&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20:23:56:962&lt;/TD&gt;&lt;TD&gt;0.0000625&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;0.0642700195&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20:23:56:962&lt;/TD&gt;&lt;TD&gt;0.000125&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;0.0927124023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20:24:14:964&lt;/TD&gt;&lt;TD&gt;18.002&lt;/TD&gt;&lt;TD&gt;B event&lt;/TD&gt;&lt;TD&gt;-0.013092041&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd be very grateful for your help.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2019 07:53:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Merging-time-series-with-timestamp-and-duration/m-p/222179#M44333</guid>
      <dc:creator>WHG</dc:creator>
      <dc:date>2019-08-19T07:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: Merging time series with timestamp and duration</title>
      <link>https://community.jmp.com/t5/Discussions/Merging-time-series-with-timestamp-and-duration/m-p/222197#M44335</link>
      <description>Here you can find how to join two data tables in JMP&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.youtube.com/watch?v=UrW0X3XfHFA" target="_blank"&gt;https://www.youtube.com/watch?v=UrW0X3XfHFA&lt;/A&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Aug 2019 12:38:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Merging-time-series-with-timestamp-and-duration/m-p/222197#M44335</guid>
      <dc:creator>FN</dc:creator>
      <dc:date>2019-08-19T12:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: Merging time series with timestamp and duration</title>
      <link>https://community.jmp.com/t5/Discussions/Merging-time-series-with-timestamp-and-duration/m-p/222400#M44375</link>
      <description>&lt;P&gt;Thanks. Following this path, I would require a match of columns, but the time formats in the two tables differ: One is an unusual time stamp including milliseconds (hh:mm:ss:sss), the other a duration value in seconds (the duration starts at a certain time stamp, i.e. event).&lt;/P&gt;&lt;P&gt;My goal is to integrate a column with time stamps for every duration value. I would like to avoid rounding the duration values to milliseconds, since this would reduce the data integrity, but I'm not sure how to handle odd time stamp formats that include microseconds. If you have any suggestions, I would be very grateful.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 15:07:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Merging-time-series-with-timestamp-and-duration/m-p/222400#M44375</guid>
      <dc:creator>WHG</dc:creator>
      <dc:date>2019-08-20T15:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: Merging time series with timestamp and duration</title>
      <link>https://community.jmp.com/t5/Discussions/Merging-time-series-with-timestamp-and-duration/m-p/222462#M44389</link>
      <description>Can you please explain how to determine what rows in Data Table 2 are associated with Event A vs. what rows in Data Table 2 are associated with Even2 B?</description>
      <pubDate>Tue, 20 Aug 2019 22:19:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Merging-time-series-with-timestamp-and-duration/m-p/222462#M44389</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-08-20T22:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: Merging time series with timestamp and duration</title>
      <link>https://community.jmp.com/t5/Discussions/Merging-time-series-with-timestamp-and-duration/m-p/222465#M44391</link>
      <description>&lt;P&gt;My apologies, I didn't make it clear enough:&amp;nbsp; I would like to synchronize the two tables by associating event A in table 1 with the time duration 0s in table 2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, it would be required to simply add the time stamp of event A to the time duration value of each row in table 2, and then associate every following event with the respective "composited" time stamp.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2019 06:23:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Merging-time-series-with-timestamp-and-duration/m-p/222465#M44391</guid>
      <dc:creator>WHG</dc:creator>
      <dc:date>2019-08-21T06:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: Merging time series with timestamp and duration</title>
      <link>https://community.jmp.com/t5/Discussions/Merging-time-series-with-timestamp-and-duration/m-p/222469#M44393</link>
      <description>&lt;P&gt;I don't know if this will be helpful, but here is a script that will take your timestamp values(I am assuming the timestamp column as you have it defined is a character column), and convert them into a numeric column.&amp;nbsp; The new column can then be compared with the time(s) column for putting together the data.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="timestamp.PNG" style="width: 463px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/18937iEAE0B5C4518F1E6E/image-size/large?v=v2&amp;amp;px=999" role="button" title="timestamp.PNG" alt="timestamp.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);

// Create the sample data table
dtEvent = New Table( "Events",
	Add Rows( 2 ),
	New Column( "timestamp",
		Character,
		"Nominal",
		Set Values( {"20:23:56:962", "20:24:14:964"} )
	),
	New Column( "event",
		Character,
		"Nominal",
		Set Values( {"A event", "B event"} )
	)
);

// put in a time delay so one can see the initial data table
wait(5);

// Create a numeric version of the timestamp data
dtEvent &amp;lt;&amp;lt; New Column( "Numeric timestamp",
	Format(
		"Custom",
		Formula(
			Char( Hour( value ) ) || ":" || Char( Minute( value ) ) || ":" ||
			Char( Floor( Second( value ) ) ) || ":" || Word(
				2,
				Char( Round( Second( value ), 3 ) ),
				"."
			)
		),
		20
	),
	formula(
		Num( Word( 1, :timestamp, ":" ) ) * 3600 + Num( Word( 2, :timestamp, ":" ) ) * 60
		+Num( Word( 3, :timestamp, ":" ) ) + Num( "." || Word( 4, :timestamp, ":" ) )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Aug 2019 10:19:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Merging-time-series-with-timestamp-and-duration/m-p/222469#M44393</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-08-21T10:19:00Z</dc:date>
    </item>
  </channel>
</rss>

