<?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 Modify summary table in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Modify-summary-table/m-p/55256#M31245</link>
    <description>&lt;P&gt;I am trying to modify a summary table.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-The table has been ordered by Sub_name, Substrate_ID and Date in that order.&lt;/P&gt;
&lt;P&gt;-I want to search the table and if a Sub_name is a duplicate, a Substrate ID is a duplicate and the dates are within 1 day, then combine those rows.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -these values are ones that ran through midnight, so their dates are different, which causes them to be on seperate lines.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried the following code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;debug = RTDT &amp;lt;&amp;lt; Summary(Group( :Sub_name, :Substrate_ID, :Date ),
Mean( :Runtime ),
Freq( "None" ),
Weight( "None" ),
);
debug &amp;lt;&amp;lt; Sort( By(:Sub_name, :Substrate_ID ), Order(Ascending), Replace Table);
 
EOL = Nrows(debug);
for(i=1, i &amp;lt; (EOL), i++, Formula(
if((debug:Substrate_ID[i+1] == debug:Substrate_ID[i]) &amp;amp;
(debug:Sub_name[i+1] == debug:Sub_name[i]) &amp;amp;
((debug:Date[i+1] - debug:Date[i]) == 86400),
NewCount = :N Rows[i]+:N Rows[i+1];
:N Rows[i+1] = New Count;
NewTime = column(debug|"Mean(Runtime)")[i] + column(debug|"Mean(Runtime)")[i+1];
column(debug|"Mean(Runtime)")[i+1] = NewTime;
debug &amp;lt;&amp;lt; slect row(i) &amp;lt;&amp;lt; delete row,
);
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for any help.&lt;/P&gt;</description>
    <pubDate>Thu, 19 Apr 2018 14:51:54 GMT</pubDate>
    <dc:creator>KST-CPT</dc:creator>
    <dc:date>2018-04-19T14:51:54Z</dc:date>
    <item>
      <title>Modify summary table</title>
      <link>https://community.jmp.com/t5/Discussions/Modify-summary-table/m-p/55256#M31245</link>
      <description>&lt;P&gt;I am trying to modify a summary table.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-The table has been ordered by Sub_name, Substrate_ID and Date in that order.&lt;/P&gt;
&lt;P&gt;-I want to search the table and if a Sub_name is a duplicate, a Substrate ID is a duplicate and the dates are within 1 day, then combine those rows.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -these values are ones that ran through midnight, so their dates are different, which causes them to be on seperate lines.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried the following code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;debug = RTDT &amp;lt;&amp;lt; Summary(Group( :Sub_name, :Substrate_ID, :Date ),
Mean( :Runtime ),
Freq( "None" ),
Weight( "None" ),
);
debug &amp;lt;&amp;lt; Sort( By(:Sub_name, :Substrate_ID ), Order(Ascending), Replace Table);
 
EOL = Nrows(debug);
for(i=1, i &amp;lt; (EOL), i++, Formula(
if((debug:Substrate_ID[i+1] == debug:Substrate_ID[i]) &amp;amp;
(debug:Sub_name[i+1] == debug:Sub_name[i]) &amp;amp;
((debug:Date[i+1] - debug:Date[i]) == 86400),
NewCount = :N Rows[i]+:N Rows[i+1];
:N Rows[i+1] = New Count;
NewTime = column(debug|"Mean(Runtime)")[i] + column(debug|"Mean(Runtime)")[i+1];
column(debug|"Mean(Runtime)")[i+1] = NewTime;
debug &amp;lt;&amp;lt; slect row(i) &amp;lt;&amp;lt; delete row,
);
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for any help.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 14:51:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Modify-summary-table/m-p/55256#M31245</guid>
      <dc:creator>KST-CPT</dc:creator>
      <dc:date>2018-04-19T14:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: Modify summary table</title>
      <link>https://community.jmp.com/t5/Discussions/Modify-summary-table/m-p/55258#M31247</link>
      <description>&lt;P&gt;I think you can solve your issue very simply by using the Summary Platform for a second time&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();
dt &amp;lt;&amp;lt; Summary(
	Group( :Sub_name, :Substrate_ID ),
	Max( :Date ),
	Sum( :N Rows ),
	Sum( :Name( "Mean(Runtime)" ) ),
	Freq( "None" ),
	Weight( "None" ),
	statistics column name format( "column" ),
	Link to original data table( 0 )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Apr 2018 12:24:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Modify-summary-table/m-p/55258#M31247</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-04-19T12:24:49Z</dc:date>
    </item>
  </channel>
</rss>

