<?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: Set limit to columns without overriding other limit in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Set-limit-to-columns-without-overriding-other-limit/m-p/395464#M64616</link>
    <description>&lt;P&gt;How about setting the 0 values to missing with something like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = New Table("Untitled 2",
	Add Rows(2),
	Compress File When Saved(1),
	New Column("col", Numeric, "Continuous", Format("Best", 12), Set Values([1, 2]))
);

//both
minVal = 1;
maxVal = 2;
Eval(
	Substitute(
		Expr(
			dT:col &amp;lt;&amp;lt; set property( "Spec Limits", {LSL( _L ), USL( _U ), Show Limits( 1 )} )
			),
		Expr( _L ), If(minVal == 0, ., minVal)
		,
		Expr( _U ), If(maxVal == 0, ., maxVal)
	)
);

Show(dt:col &amp;lt;&amp;lt; Get Property("Spec Limits"));

//missing maxval
minVal = 1;
maxVal = .;
Eval(
	Substitute(
		Expr(
			dT:col &amp;lt;&amp;lt; set property( "Spec Limits", {LSL( _L ), USL( _U ), Show Limits( 1 )} )
			),
		Expr( _L ), If(minVal == 0, ., minVal)
		,
		Expr( _U ), If(maxVal == 0, ., maxVal)
	)
);

Show(dt:col &amp;lt;&amp;lt; Get Property("Spec Limits"));

//maxval 0
minVal = 1;
maxVal = 0;
Eval(
	Substitute(
		Expr(
			dT:col &amp;lt;&amp;lt; set property( "Spec Limits", {LSL( _L ), USL( _U ), Show Limits( 1 )} )
			),
		Expr( _L ), If(minVal == 0, ., minVal)
		,
		Expr( _U ), If(maxVal == 0, ., maxVal)
	)
);

Show(dt:col &amp;lt;&amp;lt; Get Property("Spec Limits"));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Jun 2021 12:26:43 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2021-06-23T12:26:43Z</dc:date>
    <item>
      <title>Set limit to columns without overriding other limit</title>
      <link>https://community.jmp.com/t5/Discussions/Set-limit-to-columns-without-overriding-other-limit/m-p/395455#M64615</link>
      <description>&lt;P&gt;I'm needing to put limits into a data column from a separate table.&amp;nbsp; That table has a "0" if that particular limit is not set.&amp;nbsp; This script works fine for loading the limits if there are no limits, or if it has both limits, but I have been unable to get it to work when there is just one limit.&amp;nbsp; It puts both in leaving the second limit set at "0".&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//set limits
		If( db_Tests:MinLimit[TestRow[1]] != 0 | db_Tests:MaxLimit[TestRow[1]] != 0, 

			Eval(
				Substitute(
						Expr(
							col &amp;lt;&amp;lt; set property( "Spec Limits", {LSL( _L ), USL( _U ), Show Limits( 1 )} )
						),
					Expr( _L ), db_Tests:MinLimit[TestRow[1]]
					,
					Expr( _U ), db_Tests:MaxLimit[TestRow[1]]
				)
			)
		);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I tried putting them in one at a time. If the LSL is not "0" update the LSL, then if USL is not "0" update that one.&amp;nbsp; The problem with that is it overwrites the first one if they both have limits.&amp;nbsp; In other words, that way works for every case except when both LSL and USL exist, but when they both exist it puts the first one in and then when it puts the second one in the first one is gone.&amp;nbsp; I'd appreciate any help on this one. Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:32:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Set-limit-to-columns-without-overriding-other-limit/m-p/395455#M64615</guid>
      <dc:creator>Lindeman1arr</dc:creator>
      <dc:date>2023-06-10T23:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: Set limit to columns without overriding other limit</title>
      <link>https://community.jmp.com/t5/Discussions/Set-limit-to-columns-without-overriding-other-limit/m-p/395464#M64616</link>
      <description>&lt;P&gt;How about setting the 0 values to missing with something like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = New Table("Untitled 2",
	Add Rows(2),
	Compress File When Saved(1),
	New Column("col", Numeric, "Continuous", Format("Best", 12), Set Values([1, 2]))
);

//both
minVal = 1;
maxVal = 2;
Eval(
	Substitute(
		Expr(
			dT:col &amp;lt;&amp;lt; set property( "Spec Limits", {LSL( _L ), USL( _U ), Show Limits( 1 )} )
			),
		Expr( _L ), If(minVal == 0, ., minVal)
		,
		Expr( _U ), If(maxVal == 0, ., maxVal)
	)
);

Show(dt:col &amp;lt;&amp;lt; Get Property("Spec Limits"));

//missing maxval
minVal = 1;
maxVal = .;
Eval(
	Substitute(
		Expr(
			dT:col &amp;lt;&amp;lt; set property( "Spec Limits", {LSL( _L ), USL( _U ), Show Limits( 1 )} )
			),
		Expr( _L ), If(minVal == 0, ., minVal)
		,
		Expr( _U ), If(maxVal == 0, ., maxVal)
	)
);

Show(dt:col &amp;lt;&amp;lt; Get Property("Spec Limits"));

//maxval 0
minVal = 1;
maxVal = 0;
Eval(
	Substitute(
		Expr(
			dT:col &amp;lt;&amp;lt; set property( "Spec Limits", {LSL( _L ), USL( _U ), Show Limits( 1 )} )
			),
		Expr( _L ), If(minVal == 0, ., minVal)
		,
		Expr( _U ), If(maxVal == 0, ., maxVal)
	)
);

Show(dt:col &amp;lt;&amp;lt; Get Property("Spec Limits"));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 12:26:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Set-limit-to-columns-without-overriding-other-limit/m-p/395464#M64616</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-06-23T12:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: Set limit to columns without overriding other limit</title>
      <link>https://community.jmp.com/t5/Discussions/Set-limit-to-columns-without-overriding-other-limit/m-p/395573#M64628</link>
      <description>Thanks, that worked great!</description>
      <pubDate>Wed, 23 Jun 2021 16:01:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Set-limit-to-columns-without-overriding-other-limit/m-p/395573#M64628</guid>
      <dc:creator>Lindeman1arr</dc:creator>
      <dc:date>2021-06-23T16:01:43Z</dc:date>
    </item>
  </channel>
</rss>

