<?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 Manipulating Summary Tables and Column Addition in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Manipulating-Summary-Tables-and-Column-Addition/m-p/40510#M23719</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have two quesitons:&lt;/P&gt;&lt;P&gt;1) How could I go about summing the values of a row between two columns. I found the snipet of code below, but it simply copies the 5th value and puts in in the new row. For each row, I want all values between the 5th row and the nth column of TR to be added.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;TotRow = dt &amp;lt;&amp;lt; Get Column Names( Numeric );
TR = N Items( TotRow );
dt &amp;lt;&amp;lt; New Column( "Total", Numeric );
For Each Row( :Total[] = (Sum( (:(Column( dt, TotRow[5 :: TR] ))) )) );&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) Secondly, how do you mainpulate summary tables. I'm attempting to sort the values in a summary table and then add a column (in that order); however, when I run the script it opens mulitple summary tables, a basic one, and one with the new columns, nor does it perform the two opeartions in th correct order. I just want the modified one and I want to be able to reference it to further add to it. Code shown below:&lt;/P&gt;&lt;PRE&gt;dt2 = dt &amp;lt;&amp;lt; Summary( Group( :Name, :Final ), Link to original data table( 0 ) );

dt2 &amp;lt;&amp;lt; Sort( By( :Final ), Order( Descending ) );
dt2 &amp;lt;&amp;lt; New Column( "Description", Character, Values( {"a", "b", "c"} ) );&lt;/PRE&gt;&lt;P&gt;Thanks! I appreciate the help this discussion board has been giving me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 15 Jun 2017 20:31:02 GMT</pubDate>
    <dc:creator>matt7109</dc:creator>
    <dc:date>2017-06-15T20:31:02Z</dc:date>
    <item>
      <title>Manipulating Summary Tables and Column Addition</title>
      <link>https://community.jmp.com/t5/Discussions/Manipulating-Summary-Tables-and-Column-Addition/m-p/40510#M23719</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have two quesitons:&lt;/P&gt;&lt;P&gt;1) How could I go about summing the values of a row between two columns. I found the snipet of code below, but it simply copies the 5th value and puts in in the new row. For each row, I want all values between the 5th row and the nth column of TR to be added.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;TotRow = dt &amp;lt;&amp;lt; Get Column Names( Numeric );
TR = N Items( TotRow );
dt &amp;lt;&amp;lt; New Column( "Total", Numeric );
For Each Row( :Total[] = (Sum( (:(Column( dt, TotRow[5 :: TR] ))) )) );&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) Secondly, how do you mainpulate summary tables. I'm attempting to sort the values in a summary table and then add a column (in that order); however, when I run the script it opens mulitple summary tables, a basic one, and one with the new columns, nor does it perform the two opeartions in th correct order. I just want the modified one and I want to be able to reference it to further add to it. Code shown below:&lt;/P&gt;&lt;PRE&gt;dt2 = dt &amp;lt;&amp;lt; Summary( Group( :Name, :Final ), Link to original data table( 0 ) );

dt2 &amp;lt;&amp;lt; Sort( By( :Final ), Order( Descending ) );
dt2 &amp;lt;&amp;lt; New Column( "Description", Character, Values( {"a", "b", "c"} ) );&lt;/PRE&gt;&lt;P&gt;Thanks! I appreciate the help this discussion board has been giving me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2017 20:31:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Manipulating-Summary-Tables-and-Column-Addition/m-p/40510#M23719</guid>
      <dc:creator>matt7109</dc:creator>
      <dc:date>2017-06-15T20:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: Manipulating Summary Tables and Column Addition</title>
      <link>https://community.jmp.com/t5/Discussions/Manipulating-Summary-Tables-and-Column-Addition/m-p/40511#M23720</link>
      <description>&lt;P&gt;Here is a script that answers both of your questions.&amp;nbsp; You need to start using&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Help==&amp;gt;Scripting Index&lt;/P&gt;
&lt;P&gt;to get the complete list of options for all functions and platforms&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\big class.jmp" );
// First way
dt &amp;lt;&amp;lt; New Column( "HW Sum", formula( :Height + :Weight ) );

// Second Way
dt &amp;lt;&amp;lt; New Column( "Create with Loop" );
For Each Row( :Create with Loop = :Height + :Weight );

// Second Question.....use the Replace Table option on the sort
dt2 = dt &amp;lt;&amp;lt; Summary( Group( :Sex ), Link to original data table( 0 ) );

dt2 &amp;lt;&amp;lt; Sort( By( :Sex ), Order( Descending ), Replace table( 1 ) );
dt2 &amp;lt;&amp;lt; New Column( "Description", Character, Values( {"a", "b", "c"} ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Jun 2017 21:01:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Manipulating-Summary-Tables-and-Column-Addition/m-p/40511#M23720</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-06-15T21:01:36Z</dc:date>
    </item>
  </channel>
</rss>

