<?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: Filter table columns based on a list in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Filter-table-columns-based-on-a-list/m-p/266913#M51994</link>
    <description>Great! Thanks for walking me through this. Very helpful!</description>
    <pubDate>Fri, 15 May 2020 13:36:56 GMT</pubDate>
    <dc:creator>Shiz</dc:creator>
    <dc:date>2020-05-15T13:36:56Z</dc:date>
    <item>
      <title>Filter table columns based on a list</title>
      <link>https://community.jmp.com/t5/Discussions/Filter-table-columns-based-on-a-list/m-p/265818#M51778</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I've been using JMP Pro for sometime, although I've never run scripts with it. I am also exploring JMP Genomics, since I do use a fair amount of 'omics' analyses using various platforms. For now, I'm in the JMP Pro world and I am trying to figure out how to filter data tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One thing I cannot figure out is how to filter (or create a new table) a table based on a list (containing column names) or on a results of a test. For example, I have a wide table (Table 1) of 600 rows x 10,000 columns. I have another table (Table 2) with a single column of column IDs from Table 1 (200 column names).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Make column groups in Table 1 based on the column IDs in Table 2?&lt;/LI&gt;&lt;LI&gt;Alternatively, make a subset of Table 1, based on the column IDs in Table 2?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I think either of these will help with my workflow, but I have not been able to find a solution on the forums here or within the help guide.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 17:03:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Filter-table-columns-based-on-a-list/m-p/265818#M51778</guid>
      <dc:creator>Shiz</dc:creator>
      <dc:date>2020-05-11T17:03:29Z</dc:date>
    </item>
    <item>
      <title>Re: Filter table columns based on a list</title>
      <link>https://community.jmp.com/t5/Discussions/Filter-table-columns-based-on-a-list/m-p/265851#M51780</link>
      <description>&lt;P&gt;Here is a simple script that shows you both of the requests you specified&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt=open("$SAMPLE_DATA/semiconductor capability.jmp");

dtSingle = New Table("Single Column", new column("Cols", character,values({"PNP2","NPN3","INM1"})));

// Create a group
theList = dtSingle:Cols &amp;lt;&amp;lt; get values;
dt &amp;lt;&amp;lt; group columns( theList);

// Create a subset
// Select columns in data table dt, that are in dtSingle
try( dt &amp;lt;&amp;lt; Select Columns( dtSingle:Cols &amp;lt;&amp;lt; get values ));
dtSubset = dt &amp;lt;&amp;lt; subset( selected rows(0), selected columns(1) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 May 2020 17:55:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Filter-table-columns-based-on-a-list/m-p/265851#M51780</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-05-11T17:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: Filter table columns based on a list</title>
      <link>https://community.jmp.com/t5/Discussions/Filter-table-columns-based-on-a-list/m-p/266383#M51881</link>
      <description>&lt;P&gt;Thanks Jim!&lt;/P&gt;&lt;P&gt;I was able to get the "create a subset" script to work on my 2 data tables, but the "create a group" on those same 2 tables doesn't seem to create the group in the main table. It works fine on the sample data example though. Probably missing something obvious :)&lt;/img&gt; Thanks for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt = Current Data Table();
dtSingle = Open ("TCAlist.jmp");

// Create a group
theList = dtSingle:Cols &amp;lt;&amp;lt; get values;
dt &amp;lt;&amp;lt; group columns(theList);

// Create a subset
// Select columns in data table dt, that are in dtSingle
try( dt &amp;lt;&amp;lt; Select Columns( dtSingle:Cols &amp;lt;&amp;lt; get values ));
dtSubset = dt &amp;lt;&amp;lt; subset( selected rows(0), selected columns(1) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 May 2020 14:06:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Filter-table-columns-based-on-a-list/m-p/266383#M51881</guid>
      <dc:creator>Shiz</dc:creator>
      <dc:date>2020-05-13T14:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: Filter table columns based on a list</title>
      <link>https://community.jmp.com/t5/Discussions/Filter-table-columns-based-on-a-list/m-p/266403#M51884</link>
      <description>What messages are in the log? Are the columns all spelled correctly?  Is there and upper/lower case issue???</description>
      <pubDate>Wed, 13 May 2020 14:29:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Filter-table-columns-based-on-a-list/m-p/266403#M51884</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-05-13T14:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: Filter table columns based on a list</title>
      <link>https://community.jmp.com/t5/Discussions/Filter-table-columns-based-on-a-list/m-p/266412#M51887</link>
      <description>So there are no messages/errors that appear. The columns are spelled correctly and there is no case issue. When I run this, the second part of the script works...it creates a subset with the 3 items listed in "TCAlist". The only thing that doesn't happen is the creation of the group on the main table. Is there something wrong with the first few lines regarding my tables? Does the current data table throw this off?</description>
      <pubDate>Wed, 13 May 2020 14:55:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Filter-table-columns-based-on-a-list/m-p/266412#M51887</guid>
      <dc:creator>Shiz</dc:creator>
      <dc:date>2020-05-13T14:55:32Z</dc:date>
    </item>
    <item>
      <title>Re: Filter table columns based on a list</title>
      <link>https://community.jmp.com/t5/Discussions/Filter-table-columns-based-on-a-list/m-p/266420#M51891</link>
      <description>&lt;P&gt;If you can attach the 2 data tables, I will take a look at the issue&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 15:28:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Filter-table-columns-based-on-a-list/m-p/266420#M51891</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-05-13T15:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: Filter table columns based on a list</title>
      <link>https://community.jmp.com/t5/Discussions/Filter-table-columns-based-on-a-list/m-p/266464#M51905</link>
      <description />
      <pubDate>Wed, 13 May 2020 17:19:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Filter-table-columns-based-on-a-list/m-p/266464#M51905</guid>
      <dc:creator>Shiz</dc:creator>
      <dc:date>2020-05-13T17:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: Filter table columns based on a list</title>
      <link>https://community.jmp.com/t5/Discussions/Filter-table-columns-based-on-a-list/m-p/266472#M51909</link>
      <description>&lt;P&gt;From my testing, I believe that the list is being created, but it is getting lost in the number of columns you have.&amp;nbsp; So I have made a simple change to the code, adding a name for the list, and then telling the list to be moved to the front of the list of columns.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt = Current Data Table();
dtSingle = open ("TCAlist.jmp");

//longList=dt&amp;lt;&amp;lt;get column names(string)
//contains(longList,theList[3])
// Create a group
theList = dtSingle:Cols &amp;lt;&amp;lt; get values;
dt &amp;lt;&amp;lt; group columns("myList", theList);
dt &amp;lt;&amp;lt; move column group( to first, "myList");

// Create a subset
// Select columns in data table dt, that are in dtSingle
try( dt &amp;lt;&amp;lt; Select Columns( dtSingle:Cols &amp;lt;&amp;lt; get values ));
dtSubset = dt &amp;lt;&amp;lt; subset( selected rows(0), selected columns(1) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 May 2020 17:48:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Filter-table-columns-based-on-a-list/m-p/266472#M51909</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-05-13T17:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: Filter table columns based on a list</title>
      <link>https://community.jmp.com/t5/Discussions/Filter-table-columns-based-on-a-list/m-p/266913#M51994</link>
      <description>Great! Thanks for walking me through this. Very helpful!</description>
      <pubDate>Fri, 15 May 2020 13:36:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Filter-table-columns-based-on-a-list/m-p/266913#M51994</guid>
      <dc:creator>Shiz</dc:creator>
      <dc:date>2020-05-15T13:36:56Z</dc:date>
    </item>
  </channel>
</rss>

