<?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 Working with matching values from lists to tables in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Working-with-matching-values-from-lists-to-tables/m-p/62125#M33467</link>
    <description>&lt;P&gt;I have two lists extracted from a data set, one list contains column names and another, certain values extracted (one value from each column) based on certain conditions.&lt;/P&gt;&lt;P&gt;List1 = {Wweight, O2 Uptake.......};&lt;/P&gt;&lt;P&gt;List2 = {38,59.08.....};&lt;BR /&gt;After this step, the user gets a JMP table like the one below as an output with options whether to remove the value extracted by the script or not:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 594px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/11376i636A1C06618D2B86/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.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;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The user either removes the value from the main table or decides to keep it.&lt;BR /&gt;What I am further trying to do is:&lt;BR /&gt;1) I run a script to find minimum values, and if the value matches the value against that column (which means that the user decided to keep the value) I want to get the next minimum value&lt;BR /&gt;2) If not, I extract the minimum value as is.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = current data table();

colNamesList = dt &amp;lt;&amp;lt; get column names( string, numeric, continuous );
nc = N Items( colNamesList );

Names = {};
MinVals = {};
MinValList = {};

For( i = 1, i &amp;lt;= nc, i++,
	Cols = Column( dt, i );

	Insert into(Names, colNamesList[i]);
	MinValue = Col Min( Cols );
	Insert into(MinVals, MinValue);
	MinRows = dt &amp;lt;&amp;lt; get rows where( As Column( Cols ) == MinValue );
	Insert into(MinValList, MinRows[1]);
	);
	
	

dt1 = new table( "Data", 
	New Column( "Column Name", character, nominal, values(Names)),
	New column( "Min value", numeric, nominal, values( MinVals)),
	New Column( "Row Number", expression, nominal, values( MinValList ));
	
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;How can I match the values to check for each row whether the user has removed the value or not?&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//Second Part

For( i = 1, i &amp;lt;= nc, i++,
	Cols = Column( dt, i );
	colMin = Col Min( Cols );
	//If value in Col min is equal to value in MinValue, then skip that value and choose the next minimum value, else add that value to a new list&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 03 Jul 2018 15:56:02 GMT</pubDate>
    <dc:creator>Aam_jmp</dc:creator>
    <dc:date>2018-07-03T15:56:02Z</dc:date>
    <item>
      <title>Working with matching values from lists to tables</title>
      <link>https://community.jmp.com/t5/Discussions/Working-with-matching-values-from-lists-to-tables/m-p/62125#M33467</link>
      <description>&lt;P&gt;I have two lists extracted from a data set, one list contains column names and another, certain values extracted (one value from each column) based on certain conditions.&lt;/P&gt;&lt;P&gt;List1 = {Wweight, O2 Uptake.......};&lt;/P&gt;&lt;P&gt;List2 = {38,59.08.....};&lt;BR /&gt;After this step, the user gets a JMP table like the one below as an output with options whether to remove the value extracted by the script or not:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 594px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/11376i636A1C06618D2B86/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.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;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The user either removes the value from the main table or decides to keep it.&lt;BR /&gt;What I am further trying to do is:&lt;BR /&gt;1) I run a script to find minimum values, and if the value matches the value against that column (which means that the user decided to keep the value) I want to get the next minimum value&lt;BR /&gt;2) If not, I extract the minimum value as is.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = current data table();

colNamesList = dt &amp;lt;&amp;lt; get column names( string, numeric, continuous );
nc = N Items( colNamesList );

Names = {};
MinVals = {};
MinValList = {};

For( i = 1, i &amp;lt;= nc, i++,
	Cols = Column( dt, i );

	Insert into(Names, colNamesList[i]);
	MinValue = Col Min( Cols );
	Insert into(MinVals, MinValue);
	MinRows = dt &amp;lt;&amp;lt; get rows where( As Column( Cols ) == MinValue );
	Insert into(MinValList, MinRows[1]);
	);
	
	

dt1 = new table( "Data", 
	New Column( "Column Name", character, nominal, values(Names)),
	New column( "Min value", numeric, nominal, values( MinVals)),
	New Column( "Row Number", expression, nominal, values( MinValList ));
	
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;How can I match the values to check for each row whether the user has removed the value or not?&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//Second Part

For( i = 1, i &amp;lt;= nc, i++,
	Cols = Column( dt, i );
	colMin = Col Min( Cols );
	//If value in Col min is equal to value in MinValue, then skip that value and choose the next minimum value, else add that value to a new list&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Jul 2018 15:56:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Working-with-matching-values-from-lists-to-tables/m-p/62125#M33467</guid>
      <dc:creator>Aam_jmp</dc:creator>
      <dc:date>2018-07-03T15:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: Working with matching values from lists to tables</title>
      <link>https://community.jmp.com/t5/Discussions/Working-with-matching-values-from-lists-to-tables/m-p/62143#M33478</link>
      <description>&lt;P&gt;You could do something like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For( i = 1, i &amp;lt;= nc, i++,
	Cols = Column( dt, i );
	colMin = Col Min( Cols );
	//If value in Col min is equal to value in MinValue, 
	//then skip that value and choose the next minimum value, else add that value to a new list
	
	//get the corresponding row in the table (if it doesn't align with the index of your loop)
	row_tmp = dt1 &amp;lt;&amp;lt; Get Rows Where(:Column Name == Cols); 
	if(Min value[row_tmp] == colMin,
		//Insert Code to look for next smallest value
	)
)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;row_tmp gets the row in dt1 where the value of Column Name matches the current column name in Cols.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 17:27:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Working-with-matching-values-from-lists-to-tables/m-p/62143#M33478</guid>
      <dc:creator>cwillden</dc:creator>
      <dc:date>2018-07-03T17:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: Working with matching values from lists to tables</title>
      <link>https://community.jmp.com/t5/Discussions/Working-with-matching-values-from-lists-to-tables/m-p/62150#M33483</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/8582"&gt;@cwillden&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 470px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/11383i49969A1259FC44DE/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I get this output for row_tmp&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 18:15:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Working-with-matching-values-from-lists-to-tables/m-p/62150#M33483</guid>
      <dc:creator>Aam_jmp</dc:creator>
      <dc:date>2018-07-03T18:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: Working with matching values from lists to tables</title>
      <link>https://community.jmp.com/t5/Discussions/Working-with-matching-values-from-lists-to-tables/m-p/62151#M33484</link>
      <description>&lt;P&gt;I probably should have included a "[1]" on the end of that definition for row_temp. Sorry, I'm shooting from the hip a bit here without actually running this through JMP with an example data table.&amp;nbsp; Make sure to wrap the whole thing in parentheses before adding the [1].&lt;/P&gt;&lt;LI-CODE lang="jsl"&gt;(row_tmp &amp;lt;span class="token operator"&amp;gt;=&amp;lt;/span&amp;gt; dt1 &amp;lt;span class="token operator"&amp;gt;&amp;lt;&amp;lt;/span&amp;gt;&amp;lt;span class="token operator"&amp;gt;&amp;lt;&amp;lt;/span&amp;gt;&amp;lt;span class="token messages"&amp;gt; Get Rows Where&amp;lt;/span&amp;gt;&amp;lt;span class="token punctuation"&amp;gt;(&amp;lt;/span&amp;gt;&amp;lt;span class="token punctuation"&amp;gt;:&amp;lt;/span&amp;gt;Column Name &amp;lt;span class="token operator"&amp;gt;==&amp;lt;/span&amp;gt; Cols&amp;lt;span class="token punctuation"&amp;gt;))[1]&amp;lt;/span&amp;gt;&amp;lt;span class="token punctuation"&amp;gt;;&amp;lt;/span&amp;gt; &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;You probably are also comparing to a name object rather than a string.&amp;nbsp; To get the column name as a string, try this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Cols = Column(dt, 1) &amp;lt;&amp;lt; Get Name;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I think with both of those changes, it should work.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jul 2018 18:46:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Working-with-matching-values-from-lists-to-tables/m-p/62151#M33484</guid>
      <dc:creator>cwillden</dc:creator>
      <dc:date>2018-07-03T18:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: Working with matching values from lists to tables</title>
      <link>https://community.jmp.com/t5/Discussions/Working-with-matching-values-from-lists-to-tables/m-p/62434#M33667</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/8582"&gt;@cwillden&lt;/a&gt;&amp;nbsp;I'm sorry, it still doesn't work for me. I just want to check if Min Values are still present in the columns of Linnerud table. But I am unable to make that script to work.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jul 2018 19:41:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Working-with-matching-values-from-lists-to-tables/m-p/62434#M33667</guid>
      <dc:creator>Aam_jmp</dc:creator>
      <dc:date>2018-07-10T19:41:40Z</dc:date>
    </item>
  </channel>
</rss>

