<?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: Value selection and copy into new columns in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Value-selection-and-copy-into-new-columns/m-p/78873#M36591</link>
    <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6878"&gt;@Jeff_Perkinson&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Thank you Jeff,&lt;/P&gt;&lt;P&gt;I had read your post too late. I just added the create subsets part to the selection you proposed and apart from the automatized name creation it works perfectly. Thank you for the suggestion.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();

dt &amp;lt;&amp;lt; New Column( "sign_0,09",
	Numeric,
	"Nominal",
	Format( "Best", 9 ),
	Formula(
		If( :Name( "p-value (two-sided test) 2" ) &amp;lt;= 0.09,
			:Name( "p-value (two-sided test) 2" )
		)
	)
);
dt &amp;lt;&amp;lt; New Column( "sign_0,05",
	Numeric,
	"Continuous",
	Format( "Best", 12 ),
	Formula(
		If( :Name( "p-value (two-sided test) 2" ) &amp;lt;= 0.05,
			:Name( "p-value (two-sided test) 2" )
		)
	)
);
dt &amp;lt;&amp;lt; New Column( "sign_0,01",
	Numeric,
	"Continuous",
	Format( "Best", 12 ),
	Formula(
		If( :Name( "p-value (two-sided test) 2" ) &amp;lt;= 0.01,
			:Name( "p-value (two-sided test) 2" )
		)
	)
);

/* Step 3 */
// We already have the rows that meet the conditions 
dt &amp;lt;&amp;lt; Select Where (Name("p-value (two-sided test)2") &amp;lt;= 0.09);
dt &amp;lt;&amp;lt; Subset( Output Table( "new_0,09" ), Selected Rows( 1 ), selected columns( 0 ) );
dt &amp;lt;&amp;lt; Select Where (Name("p-value (two-sided test)2") &amp;lt;= 0.05);
dt &amp;lt;&amp;lt; Subset( Output Table( "new_0,05" ), Selected Rows( 1 ), selected columns( 0 ) );
dt &amp;lt;&amp;lt; Select Where (Name("p-value (two-sided test)2") &amp;lt;= 0.01);
dt &amp;lt;&amp;lt; Subset( Output Table( "new_0,01" ), Selected Rows( 1 ), selected columns( 0 ) );
/* End of Step 3 */ &lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 13 Oct 2018 09:25:15 GMT</pubDate>
    <dc:creator>Pacco</dc:creator>
    <dc:date>2018-10-13T09:25:15Z</dc:date>
    <item>
      <title>Value selection and copy into new columns</title>
      <link>https://community.jmp.com/t5/Discussions/Value-selection-and-copy-into-new-columns/m-p/78825#M36561</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I´m trying to automatize a (seemingly fairly easy) &lt;STRONG&gt;value selection, column creation and copy/paste&lt;/STRONG&gt; process, however, I cannot find the right script compilation for it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) I need to create &lt;STRONG&gt;3 new columns&lt;/STRONG&gt; adding a different selection of values from one &lt;STRONG&gt;same source column&lt;/STRONG&gt; to each of those 3 new columns and create a &lt;STRONG&gt;subset&lt;/STRONG&gt; of each selection &lt;STRONG&gt;when all columns are filled in&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;2) The name of the subsets should correspond to the header of the original source file plus a new appendix.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Be aware:&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;The location of columns and the amount of rows varies in the data files I have, however, the names are all the same.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried these two scripts which of course are not correct but I do not know what to change exactly to make it work. Any suggestions?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Version 1:&lt;/STRONG&gt;&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();
//Select values to copy into new column
vals 1 = Select Where (:p-value (two-sided test)2 &amp;lt;= 0,09); //it seems that the "2" in the column name is confusing, but unfortunately, it would take a long time to go through all tables and change the column name
 // Put these in a new column 1
dt = NewColumn("sign_0,09", Numeric, Continuous, Values(vals1));
Wait( 5 );
//Column 2
vals 2 = Select Where (:p-value (two-sided test)2 &amp;lt;= 0,05);
dt&amp;lt;&amp;lt;get selected rows
dt = NewColumn("sign_0,05", Numeric, Continuous, Values(vals2));
Wait( 5 );
//Column 3
vals 3 = Select Where (:p-value (two-sided test)2 &amp;lt;= 0,01);
dt&amp;lt;&amp;lt;get selected rows
dt = NewColumn("sign_0,01", Numeric, Continuous, Values(vals3));
//Create subsets
dt &amp;lt;&amp;lt; Select where :sign_0,09 != "";
dt&amp;lt;&amp;lt; Get selected rows
//the new name should be automatically given, too, is that possible?
dt &amp;lt;&amp;lt; Subset( Output Table( "name as in original file plus _0,09 at the end" ), Selected Rows( 1 ), selected columns( 0 ) );
dt &amp;lt;&amp;lt; Select where :sign_0,05 != "";
dt&amp;lt;&amp;lt; Get selected rows
dt &amp;lt;&amp;lt; Subset( Output Table( "name as in original file plus _0,05 at the end" ), Selected Rows( 1 ), selected columns( 0 ) );
dt &amp;lt;&amp;lt; Select where :sign_0,01 != "";
dt&amp;lt;&amp;lt; Get selected rows
dt &amp;lt;&amp;lt; Subset( Output Table( "name as in original file plus _0,01 at the end" ), Selected Rows( 1 ), selected columns( 0 ) );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Version 2:&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

dt &amp;lt;&amp;lt; :p-value (two-sided test)2 = [1,?]; //the end row varies and must be found automatically
results &amp;lt;&amp;lt; New Column("sign_0,09", Numerical, Continuous);
For( i = 1, i &amp;lt;= NItems( "p-value (two-sided test)2"), i++,
    results &amp;lt;&amp;lt; Select Where (:p-value (two-sided test)2 &amp;lt;= 0,09) );
    selRows = results &amp;lt;&amp;lt; getSelectedRows;
 AsColumn( results, "sign_0,09" )[selRows] = "p-value (two-sided test)2"[i];
//same process for 2 other new columns
dt&amp;lt;&amp;lt;Subset
dt &amp;lt;&amp;lt; Select where :sign_0,09 != "";
dt&amp;lt;&amp;lt; Get selected rows
//the new name should be automatically given, too, is that possible?
dt &amp;lt;&amp;lt; Subset( Output Table( "name as in original file plus _0,09 at the end" ), Selected Rows( 1 ), selected columns( 0 ) );
//same process for other 2 columns&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;I would be very happy to find a solution as in the threads so far there is often a copy/paste into new data tables, however, "never" into a new column, and mostly it´s related to a string selection it seems. Not sure if the selection works the same for numerical data.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;Thanks for any help!&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2018 14:27:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Value-selection-and-copy-into-new-columns/m-p/78825#M36561</guid>
      <dc:creator>Pacco</dc:creator>
      <dc:date>2018-10-12T14:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: Value selection and copy into new columns</title>
      <link>https://community.jmp.com/t5/Discussions/Value-selection-and-copy-into-new-columns/m-p/78838#M36569</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/10528"&gt;@Pacco&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Lets see how I can try and help. First things first, a request from my end is when you are pasting code, please paste it using the "JSL" code block, so it is easy for the community member s to read through your code. Now, once we have taken care of that, looking through your code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1.&amp;nbsp;&lt;SPAN&gt;vals 1 = Select Where (:p-value (two-sided test)2 &amp;lt;= 0,09); /&lt;/SPAN&gt;&lt;FONT color="#339966"&gt;/it seems that the "2" in the column name is confusing, but unfortunately, it would take a long time to go through all tables and change the column name&lt;/FONT&gt;&lt;BR /&gt;- When you have a complicated name like this for a column and don't want to change it, it would be advisable to use the name() . so the above line should be re-written as :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;vals1 = Select Where (Name("p-value (two-sided test)2 ")&amp;lt;= 0,09); // I don't know if you are using European convention for the comma instead of decimal&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;2. Now, a select where statement is a message that is issued to a data table, so the above line of code should further be refined as :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;vals1 = dt &amp;lt;&amp;lt; Select Where (Name("p-value (two-sided test)2") &amp;lt;= 0,09); &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If you would be kind enough to try these suggestions and maybe provide a sample dataset, I can try to fix the other issues as well.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2018 14:30:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Value-selection-and-copy-into-new-columns/m-p/78838#M36569</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2018-10-12T14:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: Value selection and copy into new columns</title>
      <link>https://community.jmp.com/t5/Discussions/Value-selection-and-copy-into-new-columns/m-p/78839#M36570</link>
      <description>&lt;P&gt;I've read your&amp;nbsp;description of what you're trying to do but I'm having difficulty understanding it without a concrete example. Additionally, since your JSL isn't doing what you'd like it to do it's difficult to use that to guess how to help you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you post some more details about exactly what you're trying to do, preferably with screen shots of the data tables in question and what you'd like to end up with? I think that would help us in the Community to help you more directly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2018 14:32:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Value-selection-and-copy-into-new-columns/m-p/78839#M36570</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2018-10-12T14:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: Value selection and copy into new columns</title>
      <link>https://community.jmp.com/t5/Discussions/Value-selection-and-copy-into-new-columns/m-p/78840#M36571</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for the input. This is already very helpful to know.&lt;/P&gt;&lt;P&gt;I´m sorry for the wrong copying of the script. I´ll keep it in mind for next time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To make it more clear what I am trying to do I attach a stepwise overview of what the result should look like. I hope the guide gives more clarity.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also attach the example in jmp format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help!&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2018 15:59:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Value-selection-and-copy-into-new-columns/m-p/78840#M36571</guid>
      <dc:creator>Pacco</dc:creator>
      <dc:date>2018-10-12T15:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Value selection and copy into new columns</title>
      <link>https://community.jmp.com/t5/Discussions/Value-selection-and-copy-into-new-columns/m-p/78841#M36572</link>
      <description />
      <pubDate>Fri, 12 Oct 2018 16:01:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Value-selection-and-copy-into-new-columns/m-p/78841#M36572</guid>
      <dc:creator>Pacco</dc:creator>
      <dc:date>2018-10-12T16:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: Value selection and copy into new columns</title>
      <link>https://community.jmp.com/t5/Discussions/Value-selection-and-copy-into-new-columns/m-p/78842#M36573</link>
      <description>&lt;P&gt;Hi Jeff,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for having a look, too.&lt;/P&gt;&lt;P&gt;I attached the files in my reply above! I hope they clarify my question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2018 16:04:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Value-selection-and-copy-into-new-columns/m-p/78842#M36573</guid>
      <dc:creator>Pacco</dc:creator>
      <dc:date>2018-10-12T16:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: Value selection and copy into new columns</title>
      <link>https://community.jmp.com/t5/Discussions/Value-selection-and-copy-into-new-columns/m-p/78847#M36575</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/10528"&gt;@Pacco&lt;/a&gt;,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Ok, this should get you 90% of the way there.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table(); // Assuming the data table is open 

/* Step 1 - add 3 columns  */ 
dt &amp;lt;&amp;lt; New Column("sign_0,09",Numeric,Continuous)
   &amp;lt;&amp;lt; New Column("sign_0,05",Numeric,Continuous)
   &amp;lt;&amp;lt; New Column("sign_0,01",Numeric,Continuous); 

// Getting the values of column of interest 
ColVals = dt:Name("p-value (two-sided test) 2") &amp;lt;&amp;lt; Get Values; 

// Set up a dummy matrix 
Dummy = J(NRows(dt),1,.); 

// All Rows 
AllRows = Index(1,NRows(dt),1);

/* Step 2 - Select from the column based on conditions */ 
/* This could also be replaced by loop */
SR1 = dt &amp;lt;&amp;lt; Select Where(:Name("p-value (two-sided test) 2") &amp;lt;= 0.09) &amp;lt;&amp;lt; Get Selected Rows;  // You can edit this to conform to european convention of 0,09
dt &amp;lt;&amp;lt; Clear Select; 
Dummy[SR1,0] = ColVals[SR1]; 

dt:Name("sign_0,09") &amp;lt;&amp;lt; Set Values(Dummy); 

// Re-initialize dummy matrix 
Dummy = J(NRows(dt),1,.); 

SR2 = dt &amp;lt;&amp;lt; Select Where(:Name("p-value (two-sided test) 2") &amp;lt;= 0.05) &amp;lt;&amp;lt; Get Selected Rows;  // You can edit this to conform to european convention of 0,05
dt &amp;lt;&amp;lt; Clear Select; 
Dummy[SR2,0] = ColVals[SR2]; 

dt:Name("sign_0,05") &amp;lt;&amp;lt; Set Values(Dummy); 

// Re-initialize dummy matrix 
Dummy = J(NRows(dt),1,.); 

SR3 = dt &amp;lt;&amp;lt; Select Where(:Name("p-value (two-sided test) 2") &amp;lt;= 0.01) &amp;lt;&amp;lt; Get Selected Rows;  // You can edit this to conform to european convention of 0,01
dt &amp;lt;&amp;lt; Clear Select; 
Dummy[SR3,0] = ColVals[SR3]; 

dt:Name("sign_0,01") &amp;lt;&amp;lt; Set Values(Dummy); 
/* End of Step 2 */ 

/* Step 3 */
// We already have the rows that meet the conditions 
Show(SR1); 
Show(SR2); 
Show(SR3); 
/* End of Step 3 */ &lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6878"&gt;@Jeff_Perkinson&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Is there an easy way to find common elements between matrices ? Maybe Design() might help, but&amp;nbsp; can you provide an example&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;A = [1,2,3,4,5,6]; 

B = [1,2,3]; 

C = [3,5]; 


// The common element would be 3 &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; I know I could use associative arrays and the intersect functionality, but shouldn't matrices have an easy way to determine common/uncommon elements.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2018 17:45:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Value-selection-and-copy-into-new-columns/m-p/78847#M36575</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2018-10-12T17:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: Value selection and copy into new columns</title>
      <link>https://community.jmp.com/t5/Discussions/Value-selection-and-copy-into-new-columns/m-p/78848#M36576</link>
      <description>&lt;P&gt;That looks great. I will test it as soon as possible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you refer to common elements within the 3 new columns then this is only the case regarding the selected values that will be added to each of the columns!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;E.g. the selection of values &amp;lt;= 0,01 will also appear in columns with 0,05 and 0,09 and the ones &amp;lt;= 0,05 will appear also in 0,09.&lt;/P&gt;&lt;P&gt;Simplified:&lt;/P&gt;&lt;P&gt;A = [&lt;FONT color="#99CC00"&gt;0,01&lt;/FONT&gt;,&lt;FONT color="#0000FF"&gt;0,05&lt;/FONT&gt;,0,09]&lt;/P&gt;&lt;P&gt;B = [&lt;FONT color="#99CC00"&gt;0,01&lt;/FONT&gt;,&lt;FONT color="#0000FF"&gt;0,05&lt;/FONT&gt;]&lt;/P&gt;&lt;P&gt;C = [&lt;FONT color="#99CC00"&gt;0,01&lt;/FONT&gt;]&lt;/P&gt;&lt;P&gt;However, there will NOT be any other pattern or kind of "every second row is equal in all three rows" structure.&lt;/P&gt;&lt;P&gt;Thus, yes, maybe there is a way to work with matrices and make the whole process smoother.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-jsl"&gt;&lt;CODE class="  language-jsl"&gt;A &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;2&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;3&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;4&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;5&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;6&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; 

B &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;2&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;3&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; 

C &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;3&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;5&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2018 17:57:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Value-selection-and-copy-into-new-columns/m-p/78848#M36576</guid>
      <dc:creator>Pacco</dc:creator>
      <dc:date>2018-10-12T17:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: Value selection and copy into new columns</title>
      <link>https://community.jmp.com/t5/Discussions/Value-selection-and-copy-into-new-columns/m-p/78850#M36578</link>
      <description>&lt;P&gt;I see this approach but there is a simpler way that does involve changing the selected row state. Instead of this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;SR1 = dt &amp;lt;&amp;lt; Select Where(:Name("p-value (two-sided test) 2") &amp;lt;= 0.09) &amp;lt;&amp;lt; Get Selected Rows; &lt;BR /&gt;// You can edit this to conform to european convention of 0,09
dt &amp;lt;&amp;lt; Clear Select; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can just use this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;SR1 = dt &amp;lt;&amp;lt; Get Rows Where(:Name("p-value (two-sided test) 2") &amp;lt;= 0.09) 
// You can edit this to conform to european convention of 0,09&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This way you don't disturb the current row seletion.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2018 18:46:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Value-selection-and-copy-into-new-columns/m-p/78850#M36578</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2018-10-12T18:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: Value selection and copy into new columns</title>
      <link>https://community.jmp.com/t5/Discussions/Value-selection-and-copy-into-new-columns/m-p/78859#M36581</link>
      <description>&lt;P&gt;Thanks for posting some more details, that helps some.&amp;nbsp;Instead of trying to create the new columns and filling them with values all through JSL, I would just create three new formula based columns with the formula:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If( :Name( "p-value (two-sided test) 2" ) &amp;lt;= 0.09,
	:Name( "p-value (two-sided test) 2" )
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JMPScreenSnapz288.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/12782iBC420F4A62F26336/image-size/large?v=v2&amp;amp;px=999" role="button" title="JMPScreenSnapz288.png" alt="JMPScreenSnapz288.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "seas_ratio_1_monthly.jmp" );

dt &amp;lt;&amp;lt; New Column( "sign_0.09",
	Numeric,
	"Nominal",
	Format( "Best", 9 ),
	Formula(
		If( :Name( "p-value (two-sided test) 2" ) &amp;lt;= 0.09,
			:Name( "p-value (two-sided test) 2" )
		)
	)
);
dt &amp;lt;&amp;lt; New Column( "sign_0.05",
	Numeric,
	"Continuous",
	Format( "Best", 12 ),
	Formula(
		If( :Name( "p-value (two-sided test) 2" ) &amp;lt;= 0.05,
			:Name( "p-value (two-sided test) 2" )
		)
	)
);
dt &amp;lt;&amp;lt; New Column( "sign_0.01",
	Numeric,
	"Continuous",
	Format( "Best", 12 ),
	Formula(
		If( :Name( "p-value (two-sided test) 2" ) &amp;lt;= 0.01,
			:Name( "p-value (two-sided test) 2" )
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But, I must admit that I'm still not sure what the value of the data tables with only the rows that are significant at a particlar level. How are you going to use those tables? Do they need all three significance indicator columns (i.e., sign_0,09; sign_0,05; and sign_0,01)? If not you can avoid creating those columns all together and just subset the rows that less than each level. Can you tell us more about your ultimate goal and why you want data tables like you describe? We may be able to provide even easier methods.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2018 20:30:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Value-selection-and-copy-into-new-columns/m-p/78859#M36581</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2018-10-12T20:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: Value selection and copy into new columns</title>
      <link>https://community.jmp.com/t5/Discussions/Value-selection-and-copy-into-new-columns/m-p/78870#M36588</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6696"&gt;@uday_guntupalli&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ran the script with my data (your version and with the exchange of the suggestion of&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/5358"&gt;@Mark_Bailey&lt;/a&gt;) and it works to create the columns and to get the selected data into the new column.&lt;/P&gt;&lt;P&gt;However, the last part (see below) to show the selected rows does not work. I adjusted it with a Select Where and Create Subset.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;/* Step 3 */
// We already have the rows that meet the conditions 
Show(SR1); 
Show(SR2); 
Show(SR3); 
/* End of Step 3 */ &lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;/* Step 3 */
dt &amp;lt;&amp;lt; Select Where (Name("p-value (two-sided test)2") &amp;lt;= 0.09);
dt &amp;lt;&amp;lt; Subset( Output Table( "new_0,09" ), Selected Rows( 1 ), selected columns( 0 ) );
dt &amp;lt;&amp;lt; Select Where (Name("p-value (two-sided test)2") &amp;lt;= 0.05);
dt &amp;lt;&amp;lt; Subset( Output Table( "new_0,05" ), Selected Rows( 1 ), selected columns( 0 ) );
dt &amp;lt;&amp;lt; Select Where (Name("p-value (two-sided test)2") &amp;lt;= 0.01);
dt &amp;lt;&amp;lt; Subset( Output Table( "new_0,01" ), Selected Rows( 1 ), selected columns( 0 ) );
/* End of Step 3 */ &lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Oct 2018 09:22:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Value-selection-and-copy-into-new-columns/m-p/78870#M36588</guid>
      <dc:creator>Pacco</dc:creator>
      <dc:date>2018-10-13T09:22:07Z</dc:date>
    </item>
    <item>
      <title>Re: Value selection and copy into new columns</title>
      <link>https://community.jmp.com/t5/Discussions/Value-selection-and-copy-into-new-columns/m-p/78872#M36590</link>
      <description />
      <pubDate>Sat, 13 Oct 2018 09:22:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Value-selection-and-copy-into-new-columns/m-p/78872#M36590</guid>
      <dc:creator>Pacco</dc:creator>
      <dc:date>2018-10-13T09:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: Value selection and copy into new columns</title>
      <link>https://community.jmp.com/t5/Discussions/Value-selection-and-copy-into-new-columns/m-p/78873#M36591</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6878"&gt;@Jeff_Perkinson&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Thank you Jeff,&lt;/P&gt;&lt;P&gt;I had read your post too late. I just added the create subsets part to the selection you proposed and apart from the automatized name creation it works perfectly. Thank you for the suggestion.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();

dt &amp;lt;&amp;lt; New Column( "sign_0,09",
	Numeric,
	"Nominal",
	Format( "Best", 9 ),
	Formula(
		If( :Name( "p-value (two-sided test) 2" ) &amp;lt;= 0.09,
			:Name( "p-value (two-sided test) 2" )
		)
	)
);
dt &amp;lt;&amp;lt; New Column( "sign_0,05",
	Numeric,
	"Continuous",
	Format( "Best", 12 ),
	Formula(
		If( :Name( "p-value (two-sided test) 2" ) &amp;lt;= 0.05,
			:Name( "p-value (two-sided test) 2" )
		)
	)
);
dt &amp;lt;&amp;lt; New Column( "sign_0,01",
	Numeric,
	"Continuous",
	Format( "Best", 12 ),
	Formula(
		If( :Name( "p-value (two-sided test) 2" ) &amp;lt;= 0.01,
			:Name( "p-value (two-sided test) 2" )
		)
	)
);

/* Step 3 */
// We already have the rows that meet the conditions 
dt &amp;lt;&amp;lt; Select Where (Name("p-value (two-sided test)2") &amp;lt;= 0.09);
dt &amp;lt;&amp;lt; Subset( Output Table( "new_0,09" ), Selected Rows( 1 ), selected columns( 0 ) );
dt &amp;lt;&amp;lt; Select Where (Name("p-value (two-sided test)2") &amp;lt;= 0.05);
dt &amp;lt;&amp;lt; Subset( Output Table( "new_0,05" ), Selected Rows( 1 ), selected columns( 0 ) );
dt &amp;lt;&amp;lt; Select Where (Name("p-value (two-sided test)2") &amp;lt;= 0.01);
dt &amp;lt;&amp;lt; Subset( Output Table( "new_0,01" ), Selected Rows( 1 ), selected columns( 0 ) );
/* End of Step 3 */ &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 13 Oct 2018 09:25:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Value-selection-and-copy-into-new-columns/m-p/78873#M36591</guid>
      <dc:creator>Pacco</dc:creator>
      <dc:date>2018-10-13T09:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: Value selection and copy into new columns</title>
      <link>https://community.jmp.com/t5/Discussions/Value-selection-and-copy-into-new-columns/m-p/78874#M36592</link>
      <description>&lt;P&gt;Hey, here is the full version without the Show functions as those were not of any use in my case.&lt;/P&gt;&lt;P&gt;Thanky for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table(); // Assuming the data table is open

/* Step 1 - add 3 columns  */
dt &amp;lt;&amp;lt; New Column("sign_0,09",Numeric,Continuous)
   &amp;lt;&amp;lt; New Column("sign_0,05",Numeric,Continuous)
   &amp;lt;&amp;lt; New Column("sign_0,01",Numeric,Continuous);

// Getting the values of column of interest
ColVals = dt:Name("p-value (two-sided test) 2") &amp;lt;&amp;lt; Get Values;

// Set up a dummy matrix
Dummy = J(NRows(dt),1,.);

// All Rows
AllRows = Index(1,NRows(dt),1);

/* Step 2 - Select from the column based on conditions */
/* This could also be replaced by loop */
SR1 = dt &amp;lt;&amp;lt; Get Rows Where(:Name("p-value (two-sided test) 2") &amp;lt;= 0.09);
//do not change "." to "," as the programme uses "." for background calculation
Dummy[SR1,0] = ColVals[SR1];

dt:Name("sign_0,09") &amp;lt;&amp;lt; Set Values(Dummy);

// Re-initialize dummy matrix
Dummy = J(NRows(dt),1,.);

SR2 = dt &amp;lt;&amp;lt; Get Rows Where(:Name("p-value (two-sided test) 2") &amp;lt;= 0.05);
Dummy[SR2,0] = ColVals[SR2];

dt:Name("sign_0,05") &amp;lt;&amp;lt; Set Values(Dummy);

// Re-initialize dummy matrix
Dummy = J(NRows(dt),1,.);

SR3 = dt &amp;lt;&amp;lt; Get Rows Where(:Name("p-value (two-sided test) 2") &amp;lt;= 0.01);
Dummy[SR3,0] = ColVals[SR3];

dt:Name("sign_0,01") &amp;lt;&amp;lt; Set Values(Dummy);
/* End of Step 2 */

/* Step 3 */
dt &amp;lt;&amp;lt; Select Where (Name("p-value (two-sided test)2") &amp;lt;= 0.09);
dt &amp;lt;&amp;lt; Subset( Output Table( "new_0,09" ), Selected Rows( 1 ), selected columns( 0 ) );
dt &amp;lt;&amp;lt; Select Where (Name("p-value (two-sided test)2") &amp;lt;= 0.05);
dt &amp;lt;&amp;lt; Subset( Output Table( "new_0,05" ), Selected Rows( 1 ), selected columns( 0 ) );
dt &amp;lt;&amp;lt; Select Where (Name("p-value (two-sided test)2") &amp;lt;= 0.01);
dt &amp;lt;&amp;lt; Subset( Output Table( "new_0,01" ), Selected Rows( 1 ), selected columns( 0 ) );
/* End of Step 3 */&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Oct 2018 09:33:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Value-selection-and-copy-into-new-columns/m-p/78874#M36592</guid>
      <dc:creator>Pacco</dc:creator>
      <dc:date>2018-10-13T09:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: Value selection and copy into new columns</title>
      <link>https://community.jmp.com/t5/Discussions/Value-selection-and-copy-into-new-columns/m-p/78875#M36593</link>
      <description>&lt;P&gt;Hey, here is the full version without the Show functions as those were not of any use in my case.&lt;/P&gt;&lt;P&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;dt = Current Data Table(); // Assuming the data table is open

/* Step 1 - add 3 columns  */
dt &amp;lt;&amp;lt; New Column("sign_0,09",Numeric,Continuous)
   &amp;lt;&amp;lt; New Column("sign_0,05",Numeric,Continuous)
   &amp;lt;&amp;lt; New Column("sign_0,01",Numeric,Continuous);

// Getting the values of column of interest
ColVals = dt:Name("p-value (two-sided test) 2") &amp;lt;&amp;lt; Get Values;

// Set up a dummy matrix
Dummy = J(NRows(dt),1,.);

// All Rows
AllRows = Index(1,NRows(dt),1);

/* Step 2 - Select from the column based on conditions */
/* This could also be replaced by loop */
SR1 = dt &amp;lt;&amp;lt; Get Rows Where(:Name("p-value (two-sided test) 2") &amp;lt;= 0.09);
//do not change "." to "," as the programme uses "." for background calculation
Dummy[SR1,0] = ColVals[SR1];

dt:Name("sign_0,09") &amp;lt;&amp;lt; Set Values(Dummy);

// Re-initialize dummy matrix
Dummy = J(NRows(dt),1,.);

SR2 = dt &amp;lt;&amp;lt; Get Rows Where(:Name("p-value (two-sided test) 2") &amp;lt;= 0.05);
Dummy[SR2,0] = ColVals[SR2];

dt:Name("sign_0,05") &amp;lt;&amp;lt; Set Values(Dummy);

// Re-initialize dummy matrix
Dummy = J(NRows(dt),1,.);

SR3 = dt &amp;lt;&amp;lt; Get Rows Where(:Name("p-value (two-sided test) 2") &amp;lt;= 0.01);
Dummy[SR3,0] = ColVals[SR3];

dt:Name("sign_0,01") &amp;lt;&amp;lt; Set Values(Dummy);
/* End of Step 2 */

/* Step 3 */
dt &amp;lt;&amp;lt; Select Where (Name("p-value (two-sided test)2") &amp;lt;= 0.09);
dt &amp;lt;&amp;lt; Subset( Output Table( "new_0,09" ), Selected Rows( 1 ), selected columns( 0 ) );
dt &amp;lt;&amp;lt; Select Where (Name("p-value (two-sided test)2") &amp;lt;= 0.05);
dt &amp;lt;&amp;lt; Subset( Output Table( "new_0,05" ), Selected Rows( 1 ), selected columns( 0 ) );
dt &amp;lt;&amp;lt; Select Where (Name("p-value (two-sided test)2") &amp;lt;= 0.01);
dt &amp;lt;&amp;lt; Subset( Output Table( "new_0,01" ), Selected Rows( 1 ), selected columns( 0 ) );
/* End of Step 3 */&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Oct 2018 09:33:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Value-selection-and-copy-into-new-columns/m-p/78875#M36593</guid>
      <dc:creator>Pacco</dc:creator>
      <dc:date>2018-10-13T09:33:57Z</dc:date>
    </item>
  </channel>
</rss>

