<?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: How to get limits from from column and use it for other columns via JSL? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-get-limits-from-from-column-and-use-it-for-other-columns/m-p/689753#M87571</link>
    <description>&lt;P&gt;At first it's a bit "disappointing" - why is it not possible to change the color if I use this cool "show limits" feature.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But actually, it's possible - with the GUI. Just use&amp;nbsp;&lt;FONT face="courier new,courier"&gt;show limits(1)&lt;/FONT&gt; and go to the axis settings.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And on the other hand:&lt;/P&gt;&lt;P&gt;If you want to change the color via JSL - the additional tiny code to &lt;EM&gt;add&lt;/EM&gt; the lines while changing the color doesn't heart too much, right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One could think about setting the default color/line style in the preferences.&lt;BR /&gt;fully automatic - no JSL - no manual change - just lines as you want them.&lt;/P&gt;</description>
    <pubDate>Mon, 23 Oct 2023 20:48:14 GMT</pubDate>
    <dc:creator>hogi</dc:creator>
    <dc:date>2023-10-23T20:48:14Z</dc:date>
    <item>
      <title>How to get limits from from column and use it for other columns via JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-limits-from-from-column-and-use-it-for-other-columns/m-p/689360#M87526</link>
      <description>&lt;P&gt;The attached data table has got limits (LSL/USL) for each measured parameter (Current, Resistance) in the respective columns.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Without changing the data table format, how do I get the limits for each parameter to show as reference lines for example when the Median is plotted vs PartID (as in the script in the attached data table)?&lt;/P&gt;&lt;P&gt;One way I can think of doing this is to save the LSL/USL into the column properties spec limits for each parameter and show them as reference lines, but I need some JSL help for this. This would be my preferred way.&lt;/P&gt;&lt;P&gt;Add Spec Limits () is another option, but I guess, I will need to do this for each measured parameter and&amp;nbsp; in my actual data (attached is example data) the number of measured parameters is ~50, so this route is not preferable.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2023 09:55:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-limits-from-from-column-and-use-it-for-other-columns/m-p/689360#M87526</guid>
      <dc:creator>Neo</dc:creator>
      <dc:date>2023-10-23T09:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to get limits from from column and use it for other columns via JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-limits-from-from-column-and-use-it-for-other-columns/m-p/689403#M87529</link>
      <description>&lt;P&gt;Easiest (and in my opinion the best) would be to change the table format but as you cannot do that, then the other options would be using column properties (this would be a bit weird as you would have limits for limits) or graphic script. First you would have to collect all the possible limits for each of the columns (can there be different limits for same columns?), summary should work quite well for this, and then depending on your choice either add then as column properties or use then with graphic script.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2023 10:42:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-limits-from-from-column-and-use-it-for-other-columns/m-p/689403#M87529</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-10-23T10:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to get limits from from column and use it for other columns via JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-limits-from-from-column-and-use-it-for-other-columns/m-p/689457#M87537</link>
      <description>&lt;P&gt;Here is the way I would handle your table.&amp;nbsp; It moves all of the USL and LSL values into the column property for each of the columns, and then the limits are automatically displayed when you graph the columns&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1698064958871.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/57898i5E7FB8CDE71BF6F6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1698064958871.png" alt="txnelson_0-1698064958871.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

colNamesList = dt &amp;lt;&amp;lt; get column names( string, numeric );

For Each( {col}, colNamesList,
	LSL = Column( col )[(dt &amp;lt;&amp;lt; get rows where( :Label == "LSL" ))[1]];
	USL = Column( col )[(dt &amp;lt;&amp;lt; get rows where( :Label == "USL" ))[1]];
	Eval(
		Substitute(
				Expr(
					Column( col ) &amp;lt;&amp;lt; set property(
						"spec limits",
						{LSL( _LSL_ ), USL( _USL_ ), Show Limits( 1 )}
					)
				),
			Expr( _USL_ ), USL,
			Expr( _LSL_ ), LSL
		)
	);

);

// Uncomment the below 2 lines to delete the LSL and USL rows in the table
//dt &amp;lt;&amp;lt; select where(:Label == "LSL" | :Label=="LSL");
//dt &amp;lt;&amp;lt; delete rows;

Graph Builder(
	Size( 570, 578 ),
	Variables( X( :partID ), Y( :Current ), Y( :Resistance ) ),
	Elements( Position( 1, 1 ), Points( X, Y, Legend( 8 ), Jitter( "None" ) ) ),
	Elements( Position( 1, 2 ), Points( X, Y, Legend( 6 ), Jitter( "None" ) ) ),
	Local Data Filter( Add Filter( columns( :Label ), Where( :Label == {"Median"} ) ) )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2023 12:43:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-limits-from-from-column-and-use-it-for-other-columns/m-p/689457#M87537</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-10-23T12:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to get limits from from column and use it for other columns via JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-limits-from-from-column-and-use-it-for-other-columns/m-p/689484#M87538</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;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, I will try your solution now. I wanted to do something similar but cannot get the following function to work. The idea is to apply this to a column group after grouping all the tested parameter columns. I tried it for one tested parameter (Current) column but it did not work. Works fine when numbers are passed for limits but not when variables are passed. Where did I go wrong (I have tried w &amp;amp; w/o Eval() and Expr()).&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

setSpecLimits = Function( {dt_ref, colName, _LSL, _USL},
	{specLimits}, 

	tmp = Eval( Expr( dt_ref:colName &amp;lt;&amp;lt; Set Property( "Spec Limits", {LSL( _LSL ), USL( _USL ), Show Limits( 1 )} ) ) );
	Return( specLimits ); //optional
);

////Check
Clear Log();
//test before
specLims = Data Table( "exampleData" ):Current &amp;lt;&amp;lt; Get Property( "Spec Limits" ); Show( specLims ); 

//New values
_LSL = Data Table( "exampleData" ):Current[2]; Show( _LSL );
_USL = Data Table( "exampleData" ):Current[3]; Show( _USL );
dt_ref = Data Table( "exampleData" ); show (dt_ref);
colName = "Current"; Show( colName );

//call function
setSpecLimits( dt_ref, colName, _LSL, _USL ); 

//test after
specLims = Data Table( "exampleData" ):Current &amp;lt;&amp;lt; Get Property( "Spec Limits" ); Show( specLims ); 

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 23 Oct 2023 13:01:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-limits-from-from-column-and-use-it-for-other-columns/m-p/689484#M87538</guid>
      <dc:creator>Neo</dc:creator>
      <dc:date>2023-10-23T13:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to get limits from from column and use it for other columns via JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-limits-from-from-column-and-use-it-for-other-columns/m-p/689530#M87543</link>
      <description>&lt;P&gt;Instead of &lt;FONT face="courier new,courier"&gt;Substitute&lt;/FONT&gt;, you can also use &lt;FONT face="courier new,courier"&gt;Eval (Eval Expr( ...Exp()))&lt;/FONT&gt;:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Eval(EvalExpr(dt_ref:colName &amp;lt;&amp;lt; Set Property( "Spec Limits", {LSL(Expr(_LSL )), USL(Expr( _USL) ), Show Limits( 1 )} )))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;To pre-evaluate the spec limits &lt;FONT face="courier new,courier"&gt;_LSL&lt;/FONT&gt; &amp;amp; &lt;FONT face="courier new,courier"&gt;_USL&lt;/FONT&gt; they have to be inside &lt;FONT face="courier new,courier"&gt;Expr ()&lt;/FONT&gt; and get pre-evaluated via &lt;FONT face="courier new,courier"&gt;Eval Expr()&lt;/FONT&gt;.&lt;/P&gt;&lt;P&gt;After doing so, one can evaluate the whole expression via &lt;FONT face="courier new,courier"&gt;Eval()&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2023 14:38:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-limits-from-from-column-and-use-it-for-other-columns/m-p/689530#M87543</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-10-23T14:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to get limits from from column and use it for other columns via JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-limits-from-from-column-and-use-it-for-other-columns/m-p/689532#M87545</link>
      <description>&lt;P&gt;This should fix the problem&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;setSpecLimits = Function( {dt_ref, colName, _LSL, _USL},
	{specLimits}, 

	tmp = Eval(
		eval Expr(
			dt_ref:colName &amp;lt;&amp;lt; Set Property( "Spec Limits", {LSL( expr(_LSL) ), USL( expr(_USL ) ), Show Limits( 1 )} )
		)
	);
	Return( specLimits ); //optional
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 23 Oct 2023 14:37:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-limits-from-from-column-and-use-it-for-other-columns/m-p/689532#M87545</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-10-23T14:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to get limits from from column and use it for other columns via JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-limits-from-from-column-and-use-it-for-other-columns/m-p/689626#M87554</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;Thanks. Eval Expr () does the trick.&lt;/P&gt;&lt;P&gt;How do I change the spec reference lines to dashed and change dashed line color to say red?&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2023 17:00:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-limits-from-from-column-and-use-it-for-other-columns/m-p/689626#M87554</guid>
      <dc:creator>Neo</dc:creator>
      <dc:date>2023-10-23T17:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to get limits from from column and use it for other columns via JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-limits-from-from-column-and-use-it-for-other-columns/m-p/689635#M87556</link>
      <description>&lt;P&gt;You could use the GUI:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1698082106405.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/57904iF07A895F4E12F635/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_0-1698082106405.png" alt="hogi_0-1698082106405.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2023 17:28:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-limits-from-from-column-and-use-it-for-other-columns/m-p/689635#M87556</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-10-23T17:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to get limits from from column and use it for other columns via JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-limits-from-from-column-and-use-it-for-other-columns/m-p/689636#M87557</link>
      <description>&lt;P&gt;or JSL:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt:height &amp;lt;&amp;lt; Set Property("Spec Limits",{LSL( 57 ), USL( 67 )});&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;
gb = dt &amp;lt;&amp;lt; Graph Builder(
	Variables( X( :height ), Y( :weight ), Overlay( :sex ) ),
	Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) ),
);
specs=dt:height &amp;lt;&amp;lt; Get Property("Spec Limits");
LSL=specs["LSL"];
USL=specs["USL"];
report(gb)[ScaleBox(1)] &amp;lt;&amp;lt;{	Add Ref Line( LSL, "Dashed", "Red", "LSL", 1 ),
			Add Ref Line( USL, "Dashed", "Red", "USL", 1 )}&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 23 Oct 2023 17:35:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-limits-from-from-column-and-use-it-for-other-columns/m-p/689636#M87557</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-10-23T17:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to get limits from from column and use it for other columns via JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-limits-from-from-column-and-use-it-for-other-columns/m-p/689727#M87567</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/26800"&gt;@hogi&lt;/a&gt;&amp;nbsp; Thanks. I was looking for the JSL way to change solid line to dashed line and default color when the spec limits are defined and saved into column properties and then plotted automatically by JMP (as in post 3 by &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2023 19:39:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-limits-from-from-column-and-use-it-for-other-columns/m-p/689727#M87567</guid>
      <dc:creator>Neo</dc:creator>
      <dc:date>2023-10-23T19:39:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to get limits from from column and use it for other columns via JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-limits-from-from-column-and-use-it-for-other-columns/m-p/689748#M87570</link>
      <description>&lt;P&gt;Using the "Show Limits" feature of the Spec Limits, only displays a Blue Solid line.&amp;nbsp; If you want to display the limits, specifying the color, label, line type, etc. using JSL, you will need to write the code to use the message&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;obj &amp;lt;&amp;lt; add ref line(......);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;capabilities.&lt;/P&gt;
&lt;P&gt;See the Scripting Index for description and example&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2023 20:09:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-limits-from-from-column-and-use-it-for-other-columns/m-p/689748#M87570</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-10-23T20:09:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to get limits from from column and use it for other columns via JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-limits-from-from-column-and-use-it-for-other-columns/m-p/689753#M87571</link>
      <description>&lt;P&gt;At first it's a bit "disappointing" - why is it not possible to change the color if I use this cool "show limits" feature.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But actually, it's possible - with the GUI. Just use&amp;nbsp;&lt;FONT face="courier new,courier"&gt;show limits(1)&lt;/FONT&gt; and go to the axis settings.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And on the other hand:&lt;/P&gt;&lt;P&gt;If you want to change the color via JSL - the additional tiny code to &lt;EM&gt;add&lt;/EM&gt; the lines while changing the color doesn't heart too much, right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One could think about setting the default color/line style in the preferences.&lt;BR /&gt;fully automatic - no JSL - no manual change - just lines as you want them.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2023 20:48:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-limits-from-from-column-and-use-it-for-other-columns/m-p/689753#M87571</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-10-23T20:48:14Z</dc:date>
    </item>
  </channel>
</rss>

