<?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: Changing column values based on the column spec limit in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Changing-column-values-based-on-the-column-spec-limit/m-p/378999#M62877</link>
    <description>&lt;P&gt;Thank you Mr. Nelson.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had to modify the script a little bit. I changed the multiplication to addition and changed the Mean to Median. I didn't account for catastrophic failures when i made the original post. Columns 40 and 41 had col mean values that were not between the LSL and USL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Names Default To Here( 1 );
dt = Current Data Table();

colList = dt &amp;lt;&amp;lt; get column names( continuous, string );

For( i = 1, i &amp;lt;= N Items( colList ), i++,
	specs = Column( dt, colList[i] ) &amp;lt;&amp;lt; get property( "spec limits" );
	If( Is Missing( specs["LSL"] ) == 0 &amp;amp; Is Missing( specs["USL"] ) == 0,
		If( !(specs["LSL"] &amp;lt;= Col Median( Column( dt, colList[i] ) ) &amp;lt;= specs["USL"]),
			For Each Row( As Column( dt, colList[i] ) = 360 + As Column( dt, colList[i] ) )
		)
	);
);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Apr 2021 13:40:53 GMT</pubDate>
    <dc:creator>Yngeinstn</dc:creator>
    <dc:date>2021-04-22T13:40:53Z</dc:date>
    <item>
      <title>Changing column values based on the column spec limit</title>
      <link>https://community.jmp.com/t5/Discussions/Changing-column-values-based-on-the-column-spec-limit/m-p/377086#M62693</link>
      <description>&lt;P&gt;We have a phase test that sometimes likes to flop the value by 360 degrees. I would like a script that can look through the table column data, take an average and then compare it to the LSL / USL. If the sign of the average is opposite the spec limit add 360 to that value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't do a blanket If( :test &amp;lt; 0, t1 = :column + 360; t1; ) due to the way the tester handles the data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached a sample table and the last two columns are where my issue is.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:28:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Changing-column-values-based-on-the-column-spec-limit/m-p/377086#M62693</guid>
      <dc:creator>Yngeinstn</dc:creator>
      <dc:date>2023-06-10T23:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: Changing column values based on the column spec limit</title>
      <link>https://community.jmp.com/t5/Discussions/Changing-column-values-based-on-the-column-spec-limit/m-p/377108#M62695</link>
      <description>&lt;P&gt;See if this little script gives you what you want&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

colList = dt &amp;lt;&amp;lt; get column names( continuous, string );

For( i = 1, i &amp;lt;= N Items( colList ), i++,
	specs = Column( dt, colList[i] ) &amp;lt;&amp;lt; get property( "spec limits" );
	If( Is Missing( specs["LSL"] ) == 0 &amp;amp; Is Missing( specs["USL"] ) == 0,
		If( !(specs["LSL"] &amp;lt;= Col Mean( Column( dt, colList[i] ) ) &amp;lt;= specs["USL"]),
			For Each Row( As Column( dt, colList[i] ) = -1 * As Column( dt, colList[i] ) )
		)
	);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Apr 2021 17:23:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Changing-column-values-based-on-the-column-spec-limit/m-p/377108#M62695</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-04-15T17:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Changing column values based on the column spec limit</title>
      <link>https://community.jmp.com/t5/Discussions/Changing-column-values-based-on-the-column-spec-limit/m-p/378999#M62877</link>
      <description>&lt;P&gt;Thank you Mr. Nelson.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had to modify the script a little bit. I changed the multiplication to addition and changed the Mean to Median. I didn't account for catastrophic failures when i made the original post. Columns 40 and 41 had col mean values that were not between the LSL and USL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Names Default To Here( 1 );
dt = Current Data Table();

colList = dt &amp;lt;&amp;lt; get column names( continuous, string );

For( i = 1, i &amp;lt;= N Items( colList ), i++,
	specs = Column( dt, colList[i] ) &amp;lt;&amp;lt; get property( "spec limits" );
	If( Is Missing( specs["LSL"] ) == 0 &amp;amp; Is Missing( specs["USL"] ) == 0,
		If( !(specs["LSL"] &amp;lt;= Col Median( Column( dt, colList[i] ) ) &amp;lt;= specs["USL"]),
			For Each Row( As Column( dt, colList[i] ) = 360 + As Column( dt, colList[i] ) )
		)
	);
);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Apr 2021 13:40:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Changing-column-values-based-on-the-column-spec-limit/m-p/378999#M62877</guid>
      <dc:creator>Yngeinstn</dc:creator>
      <dc:date>2021-04-22T13:40:53Z</dc:date>
    </item>
  </channel>
</rss>

