<?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: Script to Create Subset and Add Columns in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Script-to-Create-Subset-and-Add-Columns/m-p/237319#M46863</link>
    <description>&lt;P&gt;You made it too complicated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//Select data table
dt = Open( "FM_OwnshipState.jmp" );
//Card1
dt &amp;lt;&amp;lt; Select Where( :LocalTime &amp;gt;= 6:59:00 &amp;amp; :LocalTime &amp;lt;= 6:59:05 );
dt1 = dt &amp;lt;&amp;lt; Subset( Output Table( "Card1.jmp" ), Selected Rows( 1 ), selected columns( 0 ) );
dt1 &amp;lt;&amp;lt; New Column ( "Pub", After Last, Character );
dt1 &amp;lt;&amp;lt; New Column ( "Beer", After Last, Character );
dt1 &amp;lt;&amp;lt; New Column ( "Drink", After Last, Character );&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 04 Dec 2019 17:22:05 GMT</pubDate>
    <dc:creator>Mark_Bailey</dc:creator>
    <dc:date>2019-12-04T17:22:05Z</dc:date>
    <item>
      <title>Script to Create Subset and Add Columns</title>
      <link>https://community.jmp.com/t5/Discussions/Script-to-Create-Subset-and-Add-Columns/m-p/237299#M46861</link>
      <description>&lt;P&gt;New to scripting here, and trying to automate some of my work tasks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My goal is to create multiple subsets from a master file and add some columns that will allow me to factorize the data.&amp;nbsp; Right now I am playing around with the data trying to learn.&amp;nbsp; Here's what I have:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//Select data table
dt = Open( "FM_OwnshipState.jmp" );
//Card1
dt &amp;lt;&amp;lt; Select Where( :LocalTime &amp;gt;= 6:59:00 &amp;amp; :LocalTime &amp;lt;= 6:59:05 );
dt &amp;lt;&amp;lt; Subset( Output Table( "Card1.jmp" ), Selected Rows( 1 ), selected columns( 0 ) );
dt1 = ( "Card1.jmp" );
Current Data Table ( dt1 );
dt1 &amp;lt;&amp;lt; New Column ( "Pub", After Last, Character );
dt1 &amp;lt;&amp;lt; New Column ( "Beer", After Last, Character );
dt1 &amp;lt;&amp;lt; New Column ( "Drink", After Last, Character );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It seems I can create the new subset, but it does not add the new columns to the subset of the data.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 17:07:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-to-Create-Subset-and-Add-Columns/m-p/237299#M46861</guid>
      <dc:creator>mjvincent87</dc:creator>
      <dc:date>2019-12-04T17:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: Script to Create Subset and Add Columns</title>
      <link>https://community.jmp.com/t5/Discussions/Script-to-Create-Subset-and-Add-Columns/m-p/237319#M46863</link>
      <description>&lt;P&gt;You made it too complicated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//Select data table
dt = Open( "FM_OwnshipState.jmp" );
//Card1
dt &amp;lt;&amp;lt; Select Where( :LocalTime &amp;gt;= 6:59:00 &amp;amp; :LocalTime &amp;lt;= 6:59:05 );
dt1 = dt &amp;lt;&amp;lt; Subset( Output Table( "Card1.jmp" ), Selected Rows( 1 ), selected columns( 0 ) );
dt1 &amp;lt;&amp;lt; New Column ( "Pub", After Last, Character );
dt1 &amp;lt;&amp;lt; New Column ( "Beer", After Last, Character );
dt1 &amp;lt;&amp;lt; New Column ( "Drink", After Last, Character );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Dec 2019 17:22:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-to-Create-Subset-and-Add-Columns/m-p/237319#M46863</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2019-12-04T17:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: Script to Create Subset and Add Columns</title>
      <link>https://community.jmp.com/t5/Discussions/Script-to-Create-Subset-and-Add-Columns/m-p/237331#M46866</link>
      <description>Good stuff, thank you!</description>
      <pubDate>Wed, 04 Dec 2019 19:49:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-to-Create-Subset-and-Add-Columns/m-p/237331#M46866</guid>
      <dc:creator>mjvincent87</dc:creator>
      <dc:date>2019-12-04T19:49:56Z</dc:date>
    </item>
  </channel>
</rss>

