<?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: Color Cells based on formula result in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/47291#M26965</link>
    <description>&lt;P&gt;This is clumsy, and there should be a more direct/obvious way to do it in JMP, but this solution can work. Thank you.&lt;/P&gt;</description>
    <pubDate>Wed, 15 Nov 2017 21:14:16 GMT</pubDate>
    <dc:creator>mjoner</dc:creator>
    <dc:date>2017-11-15T21:14:16Z</dc:date>
    <item>
      <title>Color Cells based on formula result</title>
      <link>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/46634#M26575</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I have a column (lets call it Indicator) with a formula in it that returns a 0 or a 1.&lt;/P&gt;&lt;P&gt;Right now I know how to do this:&lt;/P&gt;&lt;PRE&gt;formulaResult = :Indicator &amp;lt;&amp;lt; &lt;FONT color="#000080"&gt;Get Values&lt;/FONT&gt;;&lt;BR /&gt;:Indicator &amp;lt;&amp;lt; &lt;FONT color="#000080"&gt;Color Cells&lt;/FONT&gt;( &lt;FONT color="#993366"&gt;"red"&lt;/FONT&gt;, &lt;FONT color="#3366FF"&gt;Loc&lt;/FONT&gt;(formulaResult==&lt;FONT color="#008080"&gt;1&lt;/FONT&gt;) );&lt;/PRE&gt;&lt;P&gt;But what I really want to do is have the data table dynamically respond: if I change the data so that the Indicator switches to 0 (false), I don't want the cell to highlight any more, and if I add more data to the table and the formula calculates, I want the 1's to highlight.&lt;/P&gt;&lt;P&gt;I can't figure out how to do this with Color Cells. I thought that perhaps a strange implementation of the Color Gradient column property might work but after playing around with that for a while I couldn't get the result I wanted. Looking for some ideas.&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2017 14:31:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/46634#M26575</guid>
      <dc:creator>mjoner</dc:creator>
      <dc:date>2017-11-01T14:31:45Z</dc:date>
    </item>
    <item>
      <title>Re: Color Cells based on formula result</title>
      <link>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/46666#M26589</link>
      <description>&lt;P&gt;Try the "Value Colors" property with "Color Cells by Value" checked.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Example table
dt = New Table("test",
    Add Rows(10),
    New Column("data", Formula(Random Uniform())),
    New Column("Indicator",
        Set Property("Value Colors", {. = -12632256}),
        Formula(:data &amp;lt; 0.5),
        Color Cell by Value
    )
);

// Test if dynamic
Wait(1);
:data &amp;lt;&amp;lt; eval formula;
Wait(1);
dt &amp;lt;&amp;lt; add rows(10);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2017 21:53:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/46666#M26589</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2017-11-01T21:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: Color Cells based on formula result</title>
      <link>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/46691#M26605</link>
      <description>&lt;P&gt;Awesome! I think I oversimplified my problem a bit. Let's try this generalization.&lt;/P&gt;&lt;P&gt;Now my Indicator is now a count of defects (0, 1, 2, 3, 4, etc.). How can I color everything &amp;gt;=1 with the same color, and not color the zeroes?&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2017 13:08:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/46691#M26605</guid>
      <dc:creator>mjoner</dc:creator>
      <dc:date>2017-11-02T13:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: Color Cells based on formula result</title>
      <link>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/46700#M26610</link>
      <description>You just need to change the logic used in the column formula, for example, :data &amp;gt; 0.</description>
      <pubDate>Thu, 02 Nov 2017 15:33:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/46700#M26610</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2017-11-02T15:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: Color Cells based on formula result</title>
      <link>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/46703#M26611</link>
      <description>&lt;P&gt;Mark,&lt;/P&gt;&lt;P&gt;Of course. It makes sense that I could just create another indicator column. The only problem is this will color the cells in the indicator column rather than highlighting the number of defects, like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Table1.PNG" style="width: 142px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/8197iA3DE8B6A110E582B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Table1.PNG" alt="Table1.PNG" /&gt;&lt;/span&gt;&lt;BR /&gt;What I'd prefer is this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Table2.PNG" style="width: 76px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/8198iB2A34110B46B9D9D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Table2.PNG" alt="Table2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2017 15:54:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/46703#M26611</guid>
      <dc:creator>mjoner</dc:creator>
      <dc:date>2017-11-02T15:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: Color Cells based on formula result</title>
      <link>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/46763#M26638</link>
      <description>&lt;P&gt;Make a list that defines the&amp;nbsp;value colors the way you need, e.g. white for 0 and red for integers &amp;gt; 0. The Value Colors property seems to require that&amp;nbsp;each value to be colored&amp;nbsp;has&amp;nbsp;its own "assignment". Thus, all possible values of "Defects" must be included in the list.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Make list that defines the Value Colors 
n = 10; //set highest conceivable nr of defects
vc = {0 = 2}; // White cell color for no defects
For(i = 1, i &amp;lt;= n, i++,
    Insert Into(vc, Eval Expr(Expr(i) = 19)) // red for defects 0
);

// Example table
dt = New Table("test",
    Add Rows(50),
    New Column("Defects", Formula(Random Integer(0, 3)), Set Property("Value Colors", vc), Color Cell by Value)
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Nov 2017 00:22:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/46763#M26638</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2017-11-04T00:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: Color Cells based on formula result</title>
      <link>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/46813#M26671</link>
      <description>&lt;P&gt;For counting defects I can work with this. Sometimes I also have continuous variables that I need to work with and this solution won't work there but maybe the color gradient would work okay in that situation.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2017 14:39:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/46813#M26671</guid>
      <dc:creator>mjoner</dc:creator>
      <dc:date>2017-11-06T14:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: Color Cells based on formula result</title>
      <link>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/47240#M26933</link>
      <description>&lt;P&gt;This issue is coming up again already for me just a week later.&lt;/P&gt;&lt;P&gt;The new application is that we have a number of situations where we want to flag values that are out of spec. Neither color gradient nor value colors do a great job of this. We can certainly create a new column and color based on 0 vs 1, but if I have multiple variables with specs to enforce, I am going to have to create a new column for each variable. This will become unwieldy quickly! I'd like a better solution.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 21:09:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/47240#M26933</guid>
      <dc:creator>mjoner</dc:creator>
      <dc:date>2017-11-14T21:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: Color Cells based on formula result</title>
      <link>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/47244#M26936</link>
      <description>&lt;P&gt;Why doesn't color gradient work?&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 = Open("$SAMPLE_DATA\Big Class.jmp");
Column(dt, "weight") &amp;lt;&amp;lt; Set Property(
	"Color Gradient" ,
		{{"Something", 16387, {{255, 0, 0}, {255, 0, 0}, {0, 255, 0}, {0, 255,
		0}, {255, 0, 0}, {255, 0, 0}}, {0, 0.33333333, 0.33333334,
		0.666666666666, 0.666666666667, 1}}, Range( {64, 172, 105} )
			
		}
);
Column(dt, "weight") &amp;lt;&amp;lt; Color Cell By Value(1);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="11-14-2017 2-10-53 PM.png" style="width: 396px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/8330i8C5A40F2AB649D7A/image-size/large?v=v2&amp;amp;px=999" role="button" title="11-14-2017 2-10-53 PM.png" alt="11-14-2017 2-10-53 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 22:11:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/47244#M26936</guid>
      <dc:creator>vince_faller</dc:creator>
      <dc:date>2017-11-14T22:11:45Z</dc:date>
    </item>
    <item>
      <title>Re: Color Cells based on formula result</title>
      <link>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/47260#M26943</link>
      <description>&lt;P&gt;This is closer. It appears that the green range is approx. 92-127 for this example. Suppose my spec range is 100-135. How do I do the math to figure out the endpoints to feed into the Range function in Color Gradient? (And then I have the pain point of having to explain to other JMP users here why they need to turn two numbers, i.e., 100 and 135, into three values to satisfy the Range&amp;nbsp;function.)&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2017 13:25:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/47260#M26943</guid>
      <dc:creator>mjoner</dc:creator>
      <dc:date>2017-11-15T13:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: Color Cells based on formula result</title>
      <link>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/47263#M26945</link>
      <description>&lt;P&gt;You can do the calculations with colmin, colmax and colmean:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;frr_min = col min(:FRR);
frr_max = col max(:FRR);
frr_avg = col mean(:FRR);

// Color FRR with a gradient
column(hlt_dt, "FRR") &amp;lt;&amp;lt; Set Property( "Color Gradient", {"Light Spectral", Range(expr(frr_min), expr(frr_max), expr(frr_avg))});
column(hlt_dt, "FRR") &amp;lt;&amp;lt; color cell by value(1);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Nov 2017 14:17:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/47263#M26945</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2017-11-15T14:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: Color Cells based on formula result</title>
      <link>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/47264#M26946</link>
      <description>&lt;P&gt;Sorry. This solution doesn't allow me to color values out of a range of interest with one color (say, red), and within the range of interest with a different color (say, white). This col min, col mean, col max solution seems to be a way to simply put some defaults in to do a gradient. What was attractive about&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2610"&gt;@vince_faller&lt;/a&gt;'s solution is that it creates a custom Gradient that forces exactly two colors (I think) onto the column. What's not attractive to me yet is that I don't understand how to precisely control when I switch from my "good" color to my "bad" color.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2017 14:22:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/47264#M26946</guid>
      <dc:creator>mjoner</dc:creator>
      <dc:date>2017-11-15T14:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: Color Cells based on formula result</title>
      <link>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/47273#M26952</link>
      <description>&lt;P&gt;So basically I'm just faking a color gradient that gradients over a tiny window.&amp;nbsp; So for only two colors you only need 4 points. 0, some number very close to 0, some number very close to 1, and 1.&amp;nbsp; If you wanted more than&amp;nbsp;2 colors you'd have to calculate values from 0 to 1 at each point in your range you wanted.&amp;nbsp; for instance if you wanted 110, it you'd have to add two values at 10/35 and 10/35+.0000001&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 = Open("$SAMPLE_DATA\Big Class.jmp");
Column(dt, "weight") &amp;lt;&amp;lt; Set Property(
	"Color Gradient" ,
		{{"Something", 16387, 
		{{255, 0, 0}, {0, 255, 0}, {0, 255,	0}, {255, 0, 0}}, //list of colors
		{0, .00000001, .9999999, 1}}, //corresponding locations from 0 to 1 
		Range( {100, 135, 117.5} ) //minimum, maximum and center.  0, 1, and .5 is another way to look at it
			
		}
);
Column(dt, "weight") &amp;lt;&amp;lt; Color Cell By Value(1);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2017 17:04:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/47273#M26952</guid>
      <dc:creator>vince_faller</dc:creator>
      <dc:date>2017-11-15T17:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: Color Cells based on formula result</title>
      <link>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/47291#M26965</link>
      <description>&lt;P&gt;This is clumsy, and there should be a more direct/obvious way to do it in JMP, but this solution can work. Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2017 21:14:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/47291#M26965</guid>
      <dc:creator>mjoner</dc:creator>
      <dc:date>2017-11-15T21:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: Color Cells based on formula result</title>
      <link>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/47292#M26966</link>
      <description>&lt;P&gt;Absolutely agree.&amp;nbsp; You should definitely put in a feature request for that at support@jmp.com.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2017 21:30:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/47292#M26966</guid>
      <dc:creator>vince_faller</dc:creator>
      <dc:date>2017-11-15T21:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: Color Cells based on formula result</title>
      <link>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/47299#M26969</link>
      <description>&lt;P&gt;Maybe not obvious, but&amp;nbsp;you may find this approach less&amp;nbsp;"clumsy":&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA\Big Class.jmp");
dt &amp;lt;&amp;lt; New Column("highlight cells",
    Formula(If(100 &amp;lt; :weight &amp;lt; 135, :weight &amp;lt;&amp;lt; color cells("Red", Row()); ., .)),
    Hide(1)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Nov 2017 23:36:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/47299#M26969</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2017-11-15T23:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: Color Cells based on formula result</title>
      <link>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/47312#M26980</link>
      <description>&lt;P&gt;This approach works for me unless you change the weights. I thought I could simply add a request to set the else parameter in the If() statement to Color Cells("White",Row()) but that doesn't seem to work.&lt;/P&gt;&lt;P&gt;Also it requires a new column for each parameter that has spec limits, although I suppose we could write a creative formula that iterates through all of the columns, checks for a Spec Limits column property, and if it finds one goes and colors the appropriate columns? At least the extra column(s) are hidden.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 13:50:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/47312#M26980</guid>
      <dc:creator>mjoner</dc:creator>
      <dc:date>2017-11-16T13:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: Color Cells based on formula result</title>
      <link>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/47315#M26981</link>
      <description>&lt;P&gt;Here's the same approach with a white-coloring &lt;EM&gt;Else&lt;/EM&gt; clause. The hidden column is here numeric by default so both the Then&amp;nbsp;and the Else must return something numeric, e.g. a missing value.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open("$SAMPLE_DATA\Big Class.jmp");
dt &amp;lt;&amp;lt; New Column("highlight cells",
    Formula(If(100 &amp;lt; :weight &amp;lt; 135, :weight &amp;lt;&amp;lt; color cells("Red", Row()); ., 
    :weight &amp;lt;&amp;lt; color cells("White", Row()); .)),
    Hide(1)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 14:29:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Color-Cells-based-on-formula-result/m-p/47315#M26981</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2017-11-16T14:29:00Z</dc:date>
    </item>
  </channel>
</rss>

