<?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: How to select columns with same values in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-select-columns-with-same-values/m-p/78911#M36612</link>
    <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/10955"&gt;@Assaf1&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; What is it that you really want ? Are you trying to find all columns where all the values in column 1 are the same as all the values in column 2 ? If yes, I don't see how the logic you have will work. The logic that you are showing is only comparing the delta between the maximum and minimum value, so if you had a column where maximum is 6, minimum is -6 and another column where maximum is 7, minimum is -7 , they will both satisfy your condition even though the values in the columns are not necessarily the same&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Oct 2018 13:33:12 GMT</pubDate>
    <dc:creator>uday_guntupalli</dc:creator>
    <dc:date>2018-10-15T13:33:12Z</dc:date>
    <item>
      <title>How to select columns with same values</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-select-columns-with-same-values/m-p/78886#M36601</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;How to select columns with same values (continues and nominal)?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Assaf&lt;/P&gt;</description>
      <pubDate>Sun, 14 Oct 2018 11:33:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-select-columns-with-same-values/m-p/78886#M36601</guid>
      <dc:creator>Assaf1</dc:creator>
      <dc:date>2018-10-14T11:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to select columns with same values</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-select-columns-with-same-values/m-p/78887#M36602</link>
      <description>&lt;P&gt;Just to clarify - not doplicated columns but column that all the rows contain the same value.&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Sun, 14 Oct 2018 11:35:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-select-columns-with-same-values/m-p/78887#M36602</guid>
      <dc:creator>Assaf1</dc:creator>
      <dc:date>2018-10-14T11:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to select columns with same values</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-select-columns-with-same-values/m-p/78888#M36603</link>
      <description>&lt;P&gt;Use Rows - Row Selection - Select Where - and check the box that says compare columns.&amp;nbsp; You can select 2 columns and select all rows that match in those two columns.&amp;nbsp; If you want to extend it to more columns, just do it again, but make sure to change the drop down menu to say "restrict" to current selection.&lt;/P&gt;</description>
      <pubDate>Sun, 14 Oct 2018 15:05:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-select-columns-with-same-values/m-p/78888#M36603</guid>
      <dc:creator>dale_lehman</dc:creator>
      <dc:date>2018-10-14T15:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to select columns with same values</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-select-columns-with-same-values/m-p/78889#M36604</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/10955"&gt;@Assaf1&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;You could try something like this, I am pretty sure there are always other ways to achieve the same&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = New Table("Test"); 
Vals = Index(1,4,1);

dt &amp;lt;&amp;lt; New Column("A",Numeric,Continuous,&amp;lt;&amp;lt; Set Values(Vals))
   &amp;lt;&amp;lt; New Column("B",Numeric,Continuous,&amp;lt;&amp;lt; Set Values(Vals))
   &amp;lt;&amp;lt; New Column("C",Character,Continuous,&amp;lt;&amp;lt; Set Values({"a","b","c","d"}))
   &amp;lt;&amp;lt; New Column("D",Character,Continuous,&amp;lt;&amp;lt; Set Values({"a","b","c","d"}));
   
AVals = dt:A &amp;lt;&amp;lt; Get Values; 
BVals = dt:B &amp;lt;&amp;lt; Get Values; 
CVals = dt:C &amp;lt;&amp;lt; Get Values; 
DVals = dt:D &amp;lt;&amp;lt; Get Values;

If(All(AVals == BVals),Print("It's a match"), Print("They aren't same")); 
If(All(CVals == DVals),Print("It's a match"), Print("They aren't same")); &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 14 Oct 2018 15:11:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-select-columns-with-same-values/m-p/78889#M36604</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2018-10-14T15:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to select columns with same values</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-select-columns-with-same-values/m-p/78904#M36608</link>
      <description>&lt;P&gt;You did not specify which version of JMP that you are using. Table Summary &amp;gt; N Categories is available in JMP 12&amp;nbsp; and later. Script is also attached as a file.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);

dt = Open("$sample_data/semiconductor capability.jmp");

cnames = dt &amp;lt;&amp;lt; get column names(Continuous|Ordinal|Nominal, "String");

uni = dt  &amp;lt;&amp;lt; Summary( Invisible,
	N Categories( evalList(cnames) ),
	Freq( "None" ),
	Weight( "None" ),
	statistics column name format( "column" ),
	Link to Original Data Table(0)
);

nmiss =  dt  &amp;lt;&amp;lt; Summary( Invisible,
	N Missing( evalList(cnames) ),
	Freq( "None" ),
	Weight( "None" ),
	statistics column name format( "column" ),
	Link to Original Data Table(0)
);

ftbl = uni &amp;lt;&amp;lt; Stack( Columns(EvalList(cnames) ), 
	Source Label Column( "Name" ),
	Stacked Data Column( "N Categories" )
);
Close(uni,NoSave);

tmptbl = nmiss &amp;lt;&amp;lt; Stack(Invisible, Columns(EvalList(cnames) ), 
	Source Label Column( "Name" ),
	Stacked Data Column( "N Missing" )
);
Close(nmiss,NoSave);

ftbl &amp;lt;&amp;lt; Update( With( tmptbl ) );
Close(tmptbl, NoSave);
(ftbl &amp;lt;&amp;lt; select where ( :N Categories &amp;gt; 1)) &amp;lt;&amp;lt; delete rows;

//Note you can select columns where they have at least k unique values.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 14 Oct 2018 23:47:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-select-columns-with-same-values/m-p/78904#M36608</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2018-10-14T23:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to select columns with same values</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-select-columns-with-same-values/m-p/78908#M36610</link>
      <description>&lt;P&gt;Thanks for your support.&lt;BR /&gt;My question is to select all the column with the same value (and not opening new table with list of such column).&lt;BR /&gt;The motivation is to identify these columns and let me decide if I want to delete these columns or hide...&lt;BR /&gt;&lt;BR /&gt;I found satisfied solution:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();
dt &amp;lt;&amp;lt; clear column selection ();
m = dt &amp;lt;&amp;lt; getAllColumnsAsMatrix;
wait (0);
for(c=1, c&amp;lt;=NCol(m), c++,
if( (max(m[0,c]) - min(m[0,c]) == 0),
column (dt, c) &amp;lt;&amp;lt; set selected ();
);// Loop over the columns and record which are contains only single value

);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks a lot&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 14:26:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-select-columns-with-same-values/m-p/78908#M36610</guid>
      <dc:creator>Assaf1</dc:creator>
      <dc:date>2018-10-15T14:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to select columns with same values</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-select-columns-with-same-values/m-p/78911#M36612</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/10955"&gt;@Assaf1&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; What is it that you really want ? Are you trying to find all columns where all the values in column 1 are the same as all the values in column 2 ? If yes, I don't see how the logic you have will work. The logic that you are showing is only comparing the delta between the maximum and minimum value, so if you had a column where maximum is 6, minimum is -6 and another column where maximum is 7, minimum is -7 , they will both satisfy your condition even though the values in the columns are not necessarily the same&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 13:33:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-select-columns-with-same-values/m-p/78911#M36612</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2018-10-15T13:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to select columns with same values</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-select-columns-with-same-values/m-p/78933#M36621</link>
      <description>&lt;P&gt;I think what you're asking for is a way to find all columns that have only one value in the whole column, for example a column with only&amp;nbsp;of 1 or a column full of "X"s.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that's the case, I find that the &lt;A href="https://www.jmp.com/support/help/14/select-columns-in-the-columns-viewer.shtml" target="_blank"&gt;Columns Viewer&lt;/A&gt;&amp;nbsp;(&lt;STRONG&gt;Cols-&amp;gt;Columns Viewer&lt;/STRONG&gt;) is a good tool for doing this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JMPScreenSnapz290.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/12798iE01C8870F9E88230/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JMPScreenSnapz290.png" alt="JMPScreenSnapz290.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You can sort the Summary Statistics table by the N Categories or the Std Dev column to get all the columns with only 1 category or a Std Dev of 0 together.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JMPScreenSnapz291.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/12799i2EF3F8DAC40C9012/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JMPScreenSnapz291.png" alt="JMPScreenSnapz291.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 17:27:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-select-columns-with-same-values/m-p/78933#M36621</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2018-10-15T17:27:07Z</dc:date>
    </item>
  </channel>
</rss>

