<?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 Compare values in each row to values in first row (limits) in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Compare-values-in-each-row-to-values-in-first-row-limits/m-p/813776#M99547</link>
    <description>&lt;P&gt;Hi, I have a row of limits that I would like the rest of my rows to be compared to and highlight cells that are above that limit. How do I do that?&lt;/P&gt;&lt;P&gt;Or if someone could show me how to select the first row, that would also help.&lt;/P&gt;&lt;P&gt;This is what I am trying:&lt;/P&gt;&lt;PRE&gt;dt = Current Data Table();
dt &amp;lt;&amp;lt; select where( :"Value_in"n[Row()] &amp;gt; :"Value_in"n[Row()==0]) &amp;lt;&amp;lt; Color Cells("Red");&lt;/PRE&gt;&lt;P&gt;Thanks in advance.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 18 Nov 2024 17:01:55 GMT</pubDate>
    <dc:creator>EndersGame</dc:creator>
    <dc:date>2024-11-18T17:01:55Z</dc:date>
    <item>
      <title>Compare values in each row to values in first row (limits)</title>
      <link>https://community.jmp.com/t5/Discussions/Compare-values-in-each-row-to-values-in-first-row-limits/m-p/813776#M99547</link>
      <description>&lt;P&gt;Hi, I have a row of limits that I would like the rest of my rows to be compared to and highlight cells that are above that limit. How do I do that?&lt;/P&gt;&lt;P&gt;Or if someone could show me how to select the first row, that would also help.&lt;/P&gt;&lt;P&gt;This is what I am trying:&lt;/P&gt;&lt;PRE&gt;dt = Current Data Table();
dt &amp;lt;&amp;lt; select where( :"Value_in"n[Row()] &amp;gt; :"Value_in"n[Row()==0]) &amp;lt;&amp;lt; Color Cells("Red");&lt;/PRE&gt;&lt;P&gt;Thanks in advance.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2024 17:01:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Compare-values-in-each-row-to-values-in-first-row-limits/m-p/813776#M99547</guid>
      <dc:creator>EndersGame</dc:creator>
      <dc:date>2024-11-18T17:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: Compare values in each row to values in first row (limits)</title>
      <link>https://community.jmp.com/t5/Discussions/Compare-values-in-each-row-to-values-in-first-row-limits/m-p/813788#M99549</link>
      <description>&lt;P&gt;Welcome to the Community.&lt;/P&gt;
&lt;P&gt;Here is an example of how I would approach this&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1731950783846.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/70349i40928A85437EA4C4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1731950783846.png" alt="txnelson_0-1731950783846.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt=New Table( "Example",
	Add Rows( 100 ),
	New Column( "values",
		Formula( Random Integer( 50, 100 ) )
	),
	New Column( "limit",
		Numeric,
		Set Values(
			[90]
		)
	)
);

dt:values &amp;lt;&amp;lt; color cells(green,dt&amp;lt;&amp;lt;get rows where(:values &amp;gt; :limit[1]));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Nov 2024 17:26:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Compare-values-in-each-row-to-values-in-first-row-limits/m-p/813788#M99549</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-11-18T17:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: Compare values in each row to values in first row (limits)</title>
      <link>https://community.jmp.com/t5/Discussions/Compare-values-in-each-row-to-values-in-first-row-limits/m-p/813789#M99550</link>
      <description>&lt;P&gt;You can use data table subscripting to pick value from any row. Also it isn't necessary to select the rows&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1); 

dt = open("$SAMPLE_DATA/Big Class.jmp");

over_limit = dt &amp;lt;&amp;lt; Get Rows Where(:weight &amp;gt; :weight[1]);
:weight &amp;lt;&amp;lt; Color Cells("Red", over_limit);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Nov 2024 17:56:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Compare-values-in-each-row-to-values-in-first-row-limits/m-p/813789#M99550</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-11-18T17:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: Compare values in each row to values in first row (limits)</title>
      <link>https://community.jmp.com/t5/Discussions/Compare-values-in-each-row-to-values-in-first-row-limits/m-p/813790#M99551</link>
      <description>&lt;P&gt;Thank you, I tried something slightly different (since I need :values[0] cell to contain the limit value) and it worked. Thanks for responding!&lt;/P&gt;&lt;P&gt;Here's my code, btw, not as elegant though, and I have multiple copies of this for each of my columns I want to compare:&lt;/P&gt;&lt;PRE&gt;::dt = Current Data Table();
For( ::i = 2, ::i &amp;lt;= N Row( ::dt ), ::i++,
	If(:"colname_(unit)"n[::i] &amp;gt; :"colname_(unit)"n[1],
		:"colname_(unit)"n &amp;lt;&amp;lt; Color Cells("Red", ::i);
	);
); &lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Nov 2024 18:01:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Compare-values-in-each-row-to-values-in-first-row-limits/m-p/813790#M99551</guid>
      <dc:creator>EndersGame</dc:creator>
      <dc:date>2024-11-18T18:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: Compare values in each row to values in first row (limits)</title>
      <link>https://community.jmp.com/t5/Discussions/Compare-values-in-each-row-to-values-in-first-row-limits/m-p/813791#M99552</link>
      <description>&lt;P&gt;2 comments on your response and data table layout.&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Using a For() loop is very inefficient compared to using a Get Rows Where()&lt;/LI&gt;
&lt;LI&gt;Using a JMP data table like it is an Excel data table is problematic.&amp;nbsp; A JMP data table is designed for analysis.&amp;nbsp; Therefore, it is column based, not cell based as Ex&lt;FONT color="#FF0000"&gt;cel&amp;nbsp;&lt;FONT color="#333333"&gt;is.&amp;nbsp; A limit such as you have placed in the table forces the user to have to program around the unique rows.&amp;nbsp; The typical way to handle items such as a limit is to have them in a separate data table, or to save them as a Column Property.&amp;nbsp; JMP has a Spec Limit column property that might be exactly what you could use, and if not, then you can make up a new column property and place it in there.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Mon, 18 Nov 2024 18:39:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Compare-values-in-each-row-to-values-in-first-row-limits/m-p/813791#M99552</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-11-18T18:39:22Z</dc:date>
    </item>
  </channel>
</rss>

