<?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: Highlight cells based on matched column names in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Highlight-cells-based-on-matched-column-names/m-p/59739#M32692</link>
    <description>&lt;P&gt;I still haven't been able to figure out how I can solve this problem. I have looked aroound other questions and the scripting guide to get to my most recent script.&lt;/P&gt;&lt;P&gt;Here is my most recent script:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = current data table();
col = dt &amp;lt;&amp;lt; get column names( string );
nc = N Items( col );

For( i = 1, i &amp;lt;= nc, i++,
 Cols = Column(dt,i);
 If( Contains( col[i], "Studentized Resid" ),
 Min = dt &amp;lt;&amp;lt; get rows where(as column(Cols)==(Col Min( Cols )));
 Cols &amp;lt;&amp;lt; color cells(Yellow, Min);
 //show(Loc())
 MinValue = Col Min(Cols);
 ColValue = As List(Cols &amp;lt;&amp;lt; Get Values);
 show(Loc(ColValue,MinValue));
 show(substr(col[i], 19,100));
 
 )
 
 );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I would really appreciate if someone can show me how I can pursue using the Substring method to match columns. Thank you in advance.&lt;/P&gt;</description>
    <pubDate>Fri, 08 Jun 2018 13:04:44 GMT</pubDate>
    <dc:creator>Aam_jmp</dc:creator>
    <dc:date>2018-06-08T13:04:44Z</dc:date>
    <item>
      <title>Highlight cells based on matched column names</title>
      <link>https://community.jmp.com/t5/Discussions/Highlight-cells-based-on-matched-column-names/m-p/59078#M32499</link>
      <description>&lt;P&gt;I have a script that colors the minimum values yellow for every Studentized column in a table. I want to also highlight values adjacent to these values in raw columns. For example, for Studentized Resid Rest Pulse, the cell adjacent to -2.321144119 in Rest Pulse column i.e. 44. How can I do this in jsl? Can regex or match be helpful? Thank you &amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/10945i93DEF3DCDA3FD0FA/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;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = current data table();
col = dt &amp;lt;&amp;lt; get column names( string );
nc = N Items( col );
For( i = 1, i &amp;lt;= nc, i++,
 Cols = Column(dt,i);
 If( Contains( col[i], "Studentized Resid" ),
 Min = dt &amp;lt;&amp;lt; get rows where(as column(Cols)==(Col Min( Cols )));
 Cols &amp;lt;&amp;lt; color cells(Yellow, Min);
 )
 );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I am looking for something like 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="Capture.PNG" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/10961i85F5F83911EC9984/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jun 2018 17:24:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Highlight-cells-based-on-matched-column-names/m-p/59078#M32499</guid>
      <dc:creator>Aam_jmp</dc:creator>
      <dc:date>2018-06-04T17:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: Highlight cells based on matched column names</title>
      <link>https://community.jmp.com/t5/Discussions/Highlight-cells-based-on-matched-column-names/m-p/59094#M32503</link>
      <description>&lt;P&gt;Here's one way with hard-coded column names:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();
col = dt &amp;lt;&amp;lt; get column names( string );
nc = N Items( col );
For( i = 1, i &amp;lt;= nc, i++,
	Cols = Column( dt, i );
	If( Contains( col[i], "Studentized Resid" ),
		Min = dt &amp;lt;&amp;lt; get rows where( As Column( Cols ) == (Col Min( Cols )) );
		Cols &amp;lt;&amp;lt; color cells( Yellow, Min );
		:Rest Pulse &amp;lt;&amp;lt; color cells( Yellow, Min );
		:Run Pulse &amp;lt;&amp;lt; color cells( Yellow, Min );
		:Max Pulse &amp;lt;&amp;lt; color cells( Yellow, Min );
	);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Jun 2018 20:08:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Highlight-cells-based-on-matched-column-names/m-p/59094#M32503</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2018-06-01T20:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: Highlight cells based on matched column names</title>
      <link>https://community.jmp.com/t5/Discussions/Highlight-cells-based-on-matched-column-names/m-p/59185#M32531</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4550"&gt;@pmroz&lt;/a&gt;&amp;nbsp;thank you for the respone, however, I am looking for a more dynamic solution to such a problem since I might have&amp;nbsp;&lt;/P&gt;&lt;P&gt;a) A lot of columns&lt;/P&gt;&lt;P&gt;b) Different column names in the future.&lt;/P&gt;&lt;P&gt;Are there any JMP functions that can do the task? Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jun 2018 13:07:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Highlight-cells-based-on-matched-column-names/m-p/59185#M32531</guid>
      <dc:creator>Aam_jmp</dc:creator>
      <dc:date>2018-06-04T13:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: Highlight cells based on matched column names</title>
      <link>https://community.jmp.com/t5/Discussions/Highlight-cells-based-on-matched-column-names/m-p/59360#M32571</link>
      <description>&lt;P&gt;How do you envision the inputting of what columns need to be processed?&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you read the Scripting Guide?&amp;nbsp; There are many examples in the book that will give you ideas.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Help==&amp;gt;Books==&amp;gt;Scripting Guide&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jun 2018 15:01:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Highlight-cells-based-on-matched-column-names/m-p/59360#M32571</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-06-05T15:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: Highlight cells based on matched column names</title>
      <link>https://community.jmp.com/t5/Discussions/Highlight-cells-based-on-matched-column-names/m-p/59361#M32572</link>
      <description>&lt;P&gt;All the raw columns that have/match Studentized columns are to be highlighted. I was looking at the scriting guide and have been trying to work with Regex Match as well as substring to extract out column names without the "Studentized Resid" in it. I am keeping a list of row numbers of highlighted columns here as well, hoping it helps achieve what I want. Any better approach will be much appreciated.&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jun 2018 15:09:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Highlight-cells-based-on-matched-column-names/m-p/59361#M32572</guid>
      <dc:creator>Aam_jmp</dc:creator>
      <dc:date>2018-06-05T15:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: Highlight cells based on matched column names</title>
      <link>https://community.jmp.com/t5/Discussions/Highlight-cells-based-on-matched-column-names/m-p/59362#M32573</link>
      <description>&lt;P&gt;That sounds like a reasonable approach.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jun 2018 15:22:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Highlight-cells-based-on-matched-column-names/m-p/59362#M32573</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-06-05T15:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: Highlight cells based on matched column names</title>
      <link>https://community.jmp.com/t5/Discussions/Highlight-cells-based-on-matched-column-names/m-p/59739#M32692</link>
      <description>&lt;P&gt;I still haven't been able to figure out how I can solve this problem. I have looked aroound other questions and the scripting guide to get to my most recent script.&lt;/P&gt;&lt;P&gt;Here is my most recent script:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = current data table();
col = dt &amp;lt;&amp;lt; get column names( string );
nc = N Items( col );

For( i = 1, i &amp;lt;= nc, i++,
 Cols = Column(dt,i);
 If( Contains( col[i], "Studentized Resid" ),
 Min = dt &amp;lt;&amp;lt; get rows where(as column(Cols)==(Col Min( Cols )));
 Cols &amp;lt;&amp;lt; color cells(Yellow, Min);
 //show(Loc())
 MinValue = Col Min(Cols);
 ColValue = As List(Cols &amp;lt;&amp;lt; Get Values);
 show(Loc(ColValue,MinValue));
 show(substr(col[i], 19,100));
 
 )
 
 );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I would really appreciate if someone can show me how I can pursue using the Substring method to match columns. Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 13:04:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Highlight-cells-based-on-matched-column-names/m-p/59739#M32692</guid>
      <dc:creator>Aam_jmp</dc:creator>
      <dc:date>2018-06-08T13:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: Highlight cells based on matched column names</title>
      <link>https://community.jmp.com/t5/Discussions/Highlight-cells-based-on-matched-column-names/m-p/59756#M32698</link>
      <description>&lt;P&gt;Here is a simple rework of your script.&amp;nbsp; It works with your sample data, and should work with as many columns as you have in the data table&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();

// I changed the name from "col" to colNameList to keep from
// it being confused with the variable "Cols".  It isn't
// confusing to JMP, just to me
colNameList = dt &amp;lt;&amp;lt; get column names( string );
nc = N Items( colNameLIst );

// Loop across all columns
For( i = 1, i &amp;lt;= nc, i++, 

	// Create a variable that contains the "column" representation
	// of the column name string value
	Cols = Column( dt, i );
	
	// If the column name starts with the string "Studentized Resid"
	// and if so, then process
	// I changed this because your Substr() function below indicates
	// that the column with "Studentized Resid" will be at the beginning
	If( Left( colNameList[i], 17 ) == "Studentized Resid", 
		
		// Find the minimum value for the column
		MinValue = Col Min( Cols );
		
		// Find all of the rows that have the minimum value.  There
		// could be more than one row with the minimum value, but this
		// code only uses the first row
		MinRows = dt &amp;lt;&amp;lt; get rows where( As Column( Cols ) == MinValue );
		
		// Theoretically, there should always be a matching value for this,
		// but it is a good way to make sure the code will not fail.  Also,
		// if you ever want to deal with the posibility of more than one
		// row matching the minimum, you would do it using this type of
		// code structure
		If( N Rows( MinRows ) &amp;gt; 0,
			Cols &amp;lt;&amp;lt; color cells( Yellow, MinRows )
		);
		
		// Output the requested values
		Show( Substr( colNameList[i], 19 ), Cols[MinRows[1]] );
 
	);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Jun 2018 14:59:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Highlight-cells-based-on-matched-column-names/m-p/59756#M32698</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-06-08T14:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: Highlight cells based on matched column names</title>
      <link>https://community.jmp.com/t5/Discussions/Highlight-cells-based-on-matched-column-names/m-p/59768#M32706</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;Hi Jim, I'm sorry if I am missing anything here. I wanted to also highlight the adjacent raw columns for every studentized column. I am not able to make this work.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 17:10:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Highlight-cells-based-on-matched-column-names/m-p/59768#M32706</guid>
      <dc:creator>Aam_jmp</dc:creator>
      <dc:date>2018-06-08T17:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: Highlight cells based on matched column names</title>
      <link>https://community.jmp.com/t5/Discussions/Highlight-cells-based-on-matched-column-names/m-p/59791#M32721</link>
      <description>&lt;P&gt;Is the &lt;A href="https://www.jmp.com/support/help/14/character-functions-2.shtml#2490291" target="_self"&gt;Substr()&lt;/A&gt;&amp;nbsp;function&amp;nbsp;what you're missing?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;resid_colname="Studentized Resid Rest Pulse";

//There are 19 characters in "Studentized Resid "
 
orig_colname = substr(resid_colname, 19);

show(orig_colname);
/*:

orig_colname = "Rest Pulse";&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Jun 2018 20:17:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Highlight-cells-based-on-matched-column-names/m-p/59791#M32721</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2018-06-08T20:17:35Z</dc:date>
    </item>
    <item>
      <title>Re: Highlight cells based on matched column names</title>
      <link>https://community.jmp.com/t5/Discussions/Highlight-cells-based-on-matched-column-names/m-p/59805#M32727</link>
      <description>&lt;P&gt;I may not be understanding your issue.&amp;nbsp; If you want to color the cells adjecent to the min values found for the columns that contain "Studentized ....." then all you have to do is to do it.&amp;nbsp; You have the list of column names......colNamesList, and you are looking through the columns.&amp;nbsp; When you find a column that has "Studentized......" in it, you then find the name of the other column you want to color and the row that is the minimum value.&amp;nbsp; So that means, you also know the cells that are adjecent to the cells you are going to color.....&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;column(&amp;nbsp;Substr( colNameList[i], 19 ) ) &amp;lt;&amp;lt;&amp;nbsp;&amp;nbsp;&amp;lt;&amp;lt; color cells( Yellow, MinRows )&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and if you add this right after the coloring of the "Studentized......" column, it will&amp;nbsp; color the appropriate cell&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 22:05:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Highlight-cells-based-on-matched-column-names/m-p/59805#M32727</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-06-08T22:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: Highlight cells based on matched column names</title>
      <link>https://community.jmp.com/t5/Discussions/Highlight-cells-based-on-matched-column-names/m-p/60066#M32809</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;Do you mean something like this?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();

// I changed the name from "col" to colNameList to keep from
// it being confused with the variable "Cols".  It isn't
// confusing to JMP, just to me
colNameList = dt &amp;lt;&amp;lt; get column names( string );
nc = N Items( colNameLIst );

// Loop across all columns
For( i = 1, i &amp;lt;= nc, i++, 

	// Create a variable that contains the "column" representation
	// of the column name string value
	Cols = Column( dt, i );
	
	// If the column name starts with the string "Studentized Resid"
	// and if so, then process
	// I changed this because your Substr() function below indicates
	// that the column with "Studentized Resid" will be at the beginning
	If( Left( colNameList[i], 17 ) == "Studentized Resid", 
		
		// Find the minimum value for the column
		MinValue = Col Min( Cols );
		
		// Find all of the rows that have the minimum value.  There
		// could be more than one row with the minimum value, but this
		// code only uses the first row
		MinRows = dt &amp;lt;&amp;lt; get rows where( As Column( Cols ) == MinValue );
		
		// Theoretically, there should always be a matching value for this,
		// but it is a good way to make sure the code will not fail.  Also,
		// if you ever want to deal with the posibility of more than one
		// row matching the minimum, you would do it using this type of
		// code structure
		If( N Rows( MinRows ) &amp;gt; 0,
			Cols &amp;lt;&amp;lt; color cells( Yellow, MinRows ),
			//column( Substr( colNameList[i], 19 ) ) &amp;lt;&amp;lt; color cells( Yellow, MinRows )
		);&lt;BR /&gt;                column( Substr( colNameList[i], 19 ) ) &amp;lt;&amp;lt; color cells( Yellow, MinRows )
	)	
		
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I made it to work. Thanks a lot for the guidance.. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2018 13:29:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Highlight-cells-based-on-matched-column-names/m-p/60066#M32809</guid>
      <dc:creator>Aam_jmp</dc:creator>
      <dc:date>2018-06-12T13:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: Highlight cells based on matched column names</title>
      <link>https://community.jmp.com/t5/Discussions/Highlight-cells-based-on-matched-column-names/m-p/60067#M32810</link>
      <description>&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6878"&gt;@Jeff_Perkinson&lt;/a&gt; Hi Jeff, I have already worked the substring part out. Thanks though!!</description>
      <pubDate>Tue, 12 Jun 2018 13:12:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Highlight-cells-based-on-matched-column-names/m-p/60067#M32810</guid>
      <dc:creator>Aam_jmp</dc:creator>
      <dc:date>2018-06-12T13:12:17Z</dc:date>
    </item>
  </channel>
</rss>

