<?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 Row State select and color in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Row-State-select-and-color/m-p/85830#M38329</link>
    <description>&lt;P&gt;Okay I've tried various things to try and get this to work, but all I've got so far is a not quite functionally useable script. The deletion script works beautifully, but while the row state script -works- it doesn't quite work the way I want it to, and I'm hoping there's a way to clean it up a bit.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; New Column ( "Row State 1",
	Row State,
	Set Formula ( If( :Alarm ID == "'00000D06", Color State(70))),
);

dt &amp;lt;&amp;lt; New Column ( "Row State 2",

Row State,
Set Formula ( If( :Alarm ID == ("'000000B2"| "'000000BE"| "'0000013C"| "'0000013D"),
 Color State(6))),
);

dt &amp;lt;&amp;lt; New Column ( "Row State 3",

Row State,
Set Formula ( If( :Alarm ID == ("'0000000E"| "'00000144"| "'0000000A"| "'00000021"|
"'00000025"| "'00000027"| "'000000E9"| "'00000145"| "'000001E1"| "'00000F7C"), 
Color State(1))),
);

dt &amp;lt;&amp;lt; New Column ( "Row State 4",
	Row State,
	Set Formula ( If( :Alarm ID == "'00000E6E", Color State(38))),
);

dt &amp;lt;&amp;lt; New Column ( "Row State 5",

Row State,
Set Formula ( If( :Alarm ID == ("'00000D3B"| "'00000230"| "'00000D42"), Color State(73))),
);	 
	 
dt &amp;lt;&amp;lt; New Column ( "Row State 6",

Row State,
Set Formula ( If( :Alarm ID == ("'0000003B"| "'00000072"| "'00000E8C"), Color State(37))),
);		 
	 
dt &amp;lt;&amp;lt; New Column ( "Row State 7",
	Row State,
	Set Formula ( If( :Alarm ID == "'00000DB6", Color State(78))),
);

dt &amp;lt;&amp;lt; New Column ( "Row State 8",
	Row State,
	Set Formula ( If( :Alarm ID == "'00000E99", Color State(75))),
);

dt &amp;lt;&amp;lt; New Column ( "Row State 9",

Row State,
Set Formula ( If( :Alarm ID == ("'00000E68"| "'00000E71"| "'00000E72"| "'00000E9A"),
 Color State(72))),
);

dt &amp;lt;&amp;lt; New Column ( "Row State 10",

Row State,
Set Formula ( If( :Alarm ID == ("'0000004E"| "'0000005C"| "'0000011C"| "'00000143"|
"'00000148"| "'000001D9"| "'00000DE9"| "'00000E41"), Color State(12))),
);

dt &amp;lt;&amp;lt; New Column ( "Row State 11",
	Row State,
	Set Formula ( If( :Alarm ID == "'00000D2F", Color State(19))),
);

dt &amp;lt;&amp;lt; New Column ( "Row State 12",
	Row State,
	Set Formula ( If( :Alarm ID == "'00000D2D", Color State(28))),
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically, select row containing specific value in column Alarm ID and set the row state to the color selected. What I -want- it to do, is set the row state and highlight the row the color of the row state, presumably I can do that with an append after all the row states are set.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What this does, it creates a row state but doesn't apply it, I have to apply it manually, also it creates an individual row state for each line, which gets cluttered quickly, I suspect I may be able to use the else to at least remove lines that are not present, which would help. It also appears that the lines with multiple options is not actually working, I was hoping I could get that to work so I wouldn't have to make 1 line per code.&lt;/P&gt;&lt;P&gt;Hopefully someone can help me out, still plugging away at it when I get time, thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Dec 2018 23:49:40 GMT</pubDate>
    <dc:creator>DamionSparhawk</dc:creator>
    <dc:date>2018-12-13T23:49:40Z</dc:date>
    <item>
      <title>Row State select and color</title>
      <link>https://community.jmp.com/t5/Discussions/Row-State-select-and-color/m-p/85830#M38329</link>
      <description>&lt;P&gt;Okay I've tried various things to try and get this to work, but all I've got so far is a not quite functionally useable script. The deletion script works beautifully, but while the row state script -works- it doesn't quite work the way I want it to, and I'm hoping there's a way to clean it up a bit.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; New Column ( "Row State 1",
	Row State,
	Set Formula ( If( :Alarm ID == "'00000D06", Color State(70))),
);

dt &amp;lt;&amp;lt; New Column ( "Row State 2",

Row State,
Set Formula ( If( :Alarm ID == ("'000000B2"| "'000000BE"| "'0000013C"| "'0000013D"),
 Color State(6))),
);

dt &amp;lt;&amp;lt; New Column ( "Row State 3",

Row State,
Set Formula ( If( :Alarm ID == ("'0000000E"| "'00000144"| "'0000000A"| "'00000021"|
"'00000025"| "'00000027"| "'000000E9"| "'00000145"| "'000001E1"| "'00000F7C"), 
Color State(1))),
);

dt &amp;lt;&amp;lt; New Column ( "Row State 4",
	Row State,
	Set Formula ( If( :Alarm ID == "'00000E6E", Color State(38))),
);

dt &amp;lt;&amp;lt; New Column ( "Row State 5",

Row State,
Set Formula ( If( :Alarm ID == ("'00000D3B"| "'00000230"| "'00000D42"), Color State(73))),
);	 
	 
dt &amp;lt;&amp;lt; New Column ( "Row State 6",

Row State,
Set Formula ( If( :Alarm ID == ("'0000003B"| "'00000072"| "'00000E8C"), Color State(37))),
);		 
	 
dt &amp;lt;&amp;lt; New Column ( "Row State 7",
	Row State,
	Set Formula ( If( :Alarm ID == "'00000DB6", Color State(78))),
);

dt &amp;lt;&amp;lt; New Column ( "Row State 8",
	Row State,
	Set Formula ( If( :Alarm ID == "'00000E99", Color State(75))),
);

dt &amp;lt;&amp;lt; New Column ( "Row State 9",

Row State,
Set Formula ( If( :Alarm ID == ("'00000E68"| "'00000E71"| "'00000E72"| "'00000E9A"),
 Color State(72))),
);

dt &amp;lt;&amp;lt; New Column ( "Row State 10",

Row State,
Set Formula ( If( :Alarm ID == ("'0000004E"| "'0000005C"| "'0000011C"| "'00000143"|
"'00000148"| "'000001D9"| "'00000DE9"| "'00000E41"), Color State(12))),
);

dt &amp;lt;&amp;lt; New Column ( "Row State 11",
	Row State,
	Set Formula ( If( :Alarm ID == "'00000D2F", Color State(19))),
);

dt &amp;lt;&amp;lt; New Column ( "Row State 12",
	Row State,
	Set Formula ( If( :Alarm ID == "'00000D2D", Color State(28))),
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically, select row containing specific value in column Alarm ID and set the row state to the color selected. What I -want- it to do, is set the row state and highlight the row the color of the row state, presumably I can do that with an append after all the row states are set.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What this does, it creates a row state but doesn't apply it, I have to apply it manually, also it creates an individual row state for each line, which gets cluttered quickly, I suspect I may be able to use the else to at least remove lines that are not present, which would help. It also appears that the lines with multiple options is not actually working, I was hoping I could get that to work so I wouldn't have to make 1 line per code.&lt;/P&gt;&lt;P&gt;Hopefully someone can help me out, still plugging away at it when I get time, thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Dec 2018 23:49:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Row-State-select-and-color/m-p/85830#M38329</guid>
      <dc:creator>DamionSparhawk</dc:creator>
      <dc:date>2018-12-13T23:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: Row State select and color</title>
      <link>https://community.jmp.com/t5/Discussions/Row-State-select-and-color/m-p/85840#M38331</link>
      <description>&lt;P&gt;I might not be understanding your question correctly.&amp;nbsp; But here's my best guess at it.&amp;nbsp; First off, I've never been about to get your formula working. You can't do "something" == ("stuff"|"something") and have it evaluate true.&amp;nbsp; At least to my knowledge.&amp;nbsp; I made an example of what I think you're trying to do, but I could be way off.&amp;nbsp;&amp;nbsp;&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");
// this doesn't work
dt &amp;lt;&amp;lt; New Column("Test", formula(:age == (12 | 14 | 16)));

//this should
values = {12, 14, 16};
rows = dt &amp;lt;&amp;lt; Get Rows Where(Contains(values, :age));
//assuming they don't have color
dt &amp;lt;&amp;lt; Select Rows([1, 5, 9]);
wait(1);
rs = dt &amp;lt;&amp;lt; Get Row States;
//2^8*3 = color state(3) = red
rs[rows] = rs[rows] + 2^8*3;

dt &amp;lt;&amp;lt; Set Row States(rs);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Dec 2018 01:42:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Row-State-select-and-color/m-p/85840#M38331</guid>
      <dc:creator>vince_faller</dc:creator>
      <dc:date>2018-12-14T01:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: Row State select and color</title>
      <link>https://community.jmp.com/t5/Discussions/Row-State-select-and-color/m-p/85854#M38336</link>
      <description>&lt;P&gt;clearly I can't get my formula to work either ^.^&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Simply put, I want Row with X value highlighted one color&lt;/P&gt;&lt;P&gt;Row with Y and Z value highlighted another color&lt;/P&gt;&lt;P&gt;etc...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;specific colors are in the script already, apparently the | or argument is the problem in selecting those, I'm just not sure the right way to express it.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Dec 2018 09:03:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Row-State-select-and-color/m-p/85854#M38336</guid>
      <dc:creator>DamionSparhawk</dc:creator>
      <dc:date>2018-12-14T09:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: Row State select and color</title>
      <link>https://community.jmp.com/t5/Discussions/Row-State-select-and-color/m-p/85866#M38341</link>
      <description>&lt;P&gt;If you want to change the Color State for each of the rows, based upon your selections, the below partial script is for structure you want to use to make the changes&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

For( i = 1, i &amp;lt;= N Rows( dt ), i++,
	If(
		N Rows( Loc( {"'00000D06"}, :Alarm ID[i] ) ) &amp;gt; 0, Row State( i ) = Color State( 70 ),
		N Rows( Loc( {"'000000B2", "'000000BE", "'0000013C", "'0000013D"}, :Alarm ID[i] ) ) &amp;gt; 0, Row State( i ) = Color State( 6 ),
		N Rows(
			Loc(
				{"'0000000E", "'00000144", "'0000000A", "'00000021", "'00000025", "'00000027", "'000000E9", "'00000145", "'000001E1", "'00000F7C"},
				:Alarm ID[i]
			)
		) &amp;gt; 0, Row State( i ) = Color State( 1 ),
		N Rows( Loc( {"'00000E6E"}, :Alarm ID[i] ) ) &amp;gt; 0, Row State( i ) = Color State( 38 ),
		N Rows( Loc( {"'00000D3B", "'00000230", "'00000D42"}, :Alarm ID[i] ) ) &amp;gt; 0, Row State( i ) = Color State( 73 )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 14 Dec 2018 12:17:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Row-State-select-and-color/m-p/85866#M38341</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-12-14T12:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: Row State select and color</title>
      <link>https://community.jmp.com/t5/Discussions/Row-State-select-and-color/m-p/85874#M38348</link>
      <description>&lt;P&gt;I think this would work for you.&amp;nbsp; This assumes you don't have a color state already and that none of your items overlap.&amp;nbsp;&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");

color_aa = associative array(
	{
		// list of values are the first item, color state is the second in each list. 
		{{12, 13, 16}, 3}, 
		{{14, 15}, 4},	
		{{17}, 5}	
	}
);
dt &amp;lt;&amp;lt; Select Rows([1, 5, 9]);
rs = dt &amp;lt;&amp;lt; Get Row States;
for(values = color_aa &amp;lt;&amp;lt; First, !isempty(values), values = color_aa &amp;lt;&amp;lt; Next(values), 
	rows = dt &amp;lt;&amp;lt; Get Rows Where(Contains(values, :age));
	color = color_aa[values];
	rs[rows] = rs[rows] + 2^8*color;
);

dt &amp;lt;&amp;lt; Set Row States(rs);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Dec 2018 15:16:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Row-State-select-and-color/m-p/85874#M38348</guid>
      <dc:creator>vince_faller</dc:creator>
      <dc:date>2018-12-14T15:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: Row State select and color</title>
      <link>https://community.jmp.com/t5/Discussions/Row-State-select-and-color/m-p/85895#M38364</link>
      <description>This one works beautifully, thanks! One of the beauties of this system (and sometimes curses) is there's multiple different ways to tackle the same problem. The next one shall be quite challenging, I'll probably try and tackle it next week lol (or it could be very simple and I just don't know yet!)</description>
      <pubDate>Sat, 15 Dec 2018 05:58:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Row-State-select-and-color/m-p/85895#M38364</guid>
      <dc:creator>DamionSparhawk</dc:creator>
      <dc:date>2018-12-15T05:58:57Z</dc:date>
    </item>
  </channel>
</rss>

