<?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 Select specific columns from a table in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Select-specific-columns-from-a-table/m-p/45616#M26063</link>
    <description>&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;I have two tables and I want to subset only specific columns of the Main_Table, which are present as row values in the Cols_Needed table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example for the&amp;nbsp;tables below, I want to subset column A, I and F of Main_Table, because "A', "I" and "F" are present as row values in the Cols_Needed table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Ahmad&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dt = New Table( "Main_Table",&lt;BR /&gt;Add Rows( 8 ),&lt;BR /&gt;New Column( "A", Numeric, Continuous, Format( "Best", 12 ), Set Values( [1, 2, 3, 1, 1, 1, 1, 1] ) ),&lt;BR /&gt;New Column( "B", Numeric, Continuous, Format( "Best", 12 ), Set Values( [4, 5, 6, 1, 1, 1, 1, 1] ) ),&lt;BR /&gt;New Column( "C", Numeric, Continuous, Format( "Best", 12 ), Set Values( [7, 8, 9, 1, 1, 1, 1, 1] ) ),&lt;BR /&gt;New Column( "D", Numeric, Continuous, Format( "Best", 12 ), Set Values( [10, 11, 12, 1, 1, 1, 1, 1] ) ),&lt;BR /&gt;New Column( "E", Numeric, Continuous, Format( "Best", 12 ), Set Values( [13, 14, 15, 1, 1, 1, 1, 1] ) ),&lt;BR /&gt;New Column( "F", Numeric, Continuous, Format( "Best", 12 ), Set Values( [5, 2, 3, 1, 1, 1, 1, 1] ) ),&lt;BR /&gt;New Column( "G", Numeric, Continuous, Format( "Best", 12 ), Set Values( [99, 8, 9, 1, 1, 1, 1, 1] ) ),&lt;BR /&gt;New Column( "I", Numeric, Continuous, Format( "Best", 12 ), Set Values( [15, 14, 15, 1, 1, 1, 1, 1] ) )&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;dt = New Table( "Cols_Needed",&lt;BR /&gt;Add Rows( 3 ),&lt;BR /&gt;New Column( "Col", Character, Set Values( {"A", "I", "F"}) ),&lt;BR /&gt;New Column( "Val", Numeric, Continuous, Format( "Best", 12 ), Set Values( [1,2,3] ) )&lt;BR /&gt;);&lt;/P&gt;</description>
    <pubDate>Fri, 06 Oct 2017 17:30:22 GMT</pubDate>
    <dc:creator>aumair</dc:creator>
    <dc:date>2017-10-06T17:30:22Z</dc:date>
    <item>
      <title>Select specific columns from a table</title>
      <link>https://community.jmp.com/t5/Discussions/Select-specific-columns-from-a-table/m-p/45616#M26063</link>
      <description>&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;I have two tables and I want to subset only specific columns of the Main_Table, which are present as row values in the Cols_Needed table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example for the&amp;nbsp;tables below, I want to subset column A, I and F of Main_Table, because "A', "I" and "F" are present as row values in the Cols_Needed table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Ahmad&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dt = New Table( "Main_Table",&lt;BR /&gt;Add Rows( 8 ),&lt;BR /&gt;New Column( "A", Numeric, Continuous, Format( "Best", 12 ), Set Values( [1, 2, 3, 1, 1, 1, 1, 1] ) ),&lt;BR /&gt;New Column( "B", Numeric, Continuous, Format( "Best", 12 ), Set Values( [4, 5, 6, 1, 1, 1, 1, 1] ) ),&lt;BR /&gt;New Column( "C", Numeric, Continuous, Format( "Best", 12 ), Set Values( [7, 8, 9, 1, 1, 1, 1, 1] ) ),&lt;BR /&gt;New Column( "D", Numeric, Continuous, Format( "Best", 12 ), Set Values( [10, 11, 12, 1, 1, 1, 1, 1] ) ),&lt;BR /&gt;New Column( "E", Numeric, Continuous, Format( "Best", 12 ), Set Values( [13, 14, 15, 1, 1, 1, 1, 1] ) ),&lt;BR /&gt;New Column( "F", Numeric, Continuous, Format( "Best", 12 ), Set Values( [5, 2, 3, 1, 1, 1, 1, 1] ) ),&lt;BR /&gt;New Column( "G", Numeric, Continuous, Format( "Best", 12 ), Set Values( [99, 8, 9, 1, 1, 1, 1, 1] ) ),&lt;BR /&gt;New Column( "I", Numeric, Continuous, Format( "Best", 12 ), Set Values( [15, 14, 15, 1, 1, 1, 1, 1] ) )&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;dt = New Table( "Cols_Needed",&lt;BR /&gt;Add Rows( 3 ),&lt;BR /&gt;New Column( "Col", Character, Set Values( {"A", "I", "F"}) ),&lt;BR /&gt;New Column( "Val", Numeric, Continuous, Format( "Best", 12 ), Set Values( [1,2,3] ) )&lt;BR /&gt;);&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 17:30:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Select-specific-columns-from-a-table/m-p/45616#M26063</guid>
      <dc:creator>aumair</dc:creator>
      <dc:date>2017-10-06T17:30:22Z</dc:date>
    </item>
    <item>
      <title>Re: Select specific columns from a table</title>
      <link>https://community.jmp.com/t5/Discussions/Select-specific-columns-from-a-table/m-p/45624#M26066</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

dt1 = New Table( "Main_Table",
	Add Rows( 8 ),
	New Column( "A", Numeric, Continuous, Format( "Best", 12 ), Set Values( [1, 2, 3, 1, 1, 1, 1, 1] ) ),
	New Column( "B", Numeric, Continuous, Format( "Best", 12 ), Set Values( [4, 5, 6, 1, 1, 1, 1, 1] ) ),
	New Column( "C", Numeric, Continuous, Format( "Best", 12 ), Set Values( [7, 8, 9, 1, 1, 1, 1, 1] ) ),
	New Column( "D", Numeric, Continuous, Format( "Best", 12 ), Set Values( [10, 11, 12, 1, 1, 1, 1, 1] ) ),
	New Column( "E", Numeric, Continuous, Format( "Best", 12 ), Set Values( [13, 14, 15, 1, 1, 1, 1, 1] ) ),
	New Column( "F", Numeric, Continuous, Format( "Best", 12 ), Set Values( [5, 2, 3, 1, 1, 1, 1, 1] ) ),
	New Column( "G", Numeric, Continuous, Format( "Best", 12 ), Set Values( [99, 8, 9, 1, 1, 1, 1, 1] ) ),
	New Column( "I", Numeric, Continuous, Format( "Best", 12 ), Set Values( [15, 14, 15, 1, 1, 1, 1, 1] ) )
);

dt2 = New Table( "Cols_Needed",
	Add Rows( 3 ),
	New Column( "Col", Character, Set Values( {"A", "I", "F"} ) ),
	New Column( "Val", Numeric, Continuous, Format( "Best", 12 ), Set Values( [1, 2, 3] ) )
);

subsetCols = Column( dt2, "Col" ) &amp;lt;&amp;lt; getValues;

dt3 = dt1 &amp;lt;&amp;lt; Subset( Columns( subsetCols ) );
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Oct 2017 20:47:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Select-specific-columns-from-a-table/m-p/45624#M26066</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2017-10-06T20:47:09Z</dc:date>
    </item>
  </channel>
</rss>

