BookmarkSubscribe
Choose Language Hide Translation Bar
AdamChoen
Community Trekker

assigned spec limits from limits column

Hi,
I have a data table with the following columns, how can I assign the limits to the value column as property?
meaning when I plot value by date ill see those limits automatically

 

fdg.png

I tried 

 

:value << set property(
"spec limits",
{LSL( : LCL ) , USL( : UCL ), Target( : Target ), Show Limits( 1 )}
);

thanks!

Thanks, Adam
0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
txnelson
Super User

Re: assigned spec limits from limits column

Your example data table does not contain any columns named LSL or USL.  Assuming they do exist, but are just missing from the display your code remains with a couple of problems.  First, you are attempting to insert values into a list structure.

{LSL( : LSL ) , USL( : USL  ), Target( : Target ), Show Limits( 1 )}

Because this is a list, it will not parse and evaluate itself.

The second item, is that, Spec Limits is a column property, and therefore, only 1 set of Spec Limits can be set for your column :Value.  If you have a columns named :LSL, :Target and :USL, you will need to specify which row in the data table contains those limits.  Below is one method that can be used to add the Spec Limits.  In the code, I am assuming there are columns of :USL, :Target and :USL, and that row 5 contains the values you want to use.

Eval(
	Substitute(
			Expr(
				:value << set property(
					"spec limits",
					{LSL( __LSL__ ), USL( __USL__ ), Target( __Target__ ), Show Limits( 1 )}
				)
			),
		Expr( __LSL__ ), :LSL[5],
		Expr( __USL__ ), :USL[5],
		Expr( __Target__ ), :Target[5]
	)
);
Jim
11 REPLIES 11
Highlighted
txnelson
Super User

Re: assigned spec limits from limits column

Your example data table does not contain any columns named LSL or USL.  Assuming they do exist, but are just missing from the display your code remains with a couple of problems.  First, you are attempting to insert values into a list structure.

{LSL( : LSL ) , USL( : USL  ), Target( : Target ), Show Limits( 1 )}

Because this is a list, it will not parse and evaluate itself.

The second item, is that, Spec Limits is a column property, and therefore, only 1 set of Spec Limits can be set for your column :Value.  If you have a columns named :LSL, :Target and :USL, you will need to specify which row in the data table contains those limits.  Below is one method that can be used to add the Spec Limits.  In the code, I am assuming there are columns of :USL, :Target and :USL, and that row 5 contains the values you want to use.

Eval(
	Substitute(
			Expr(
				:value << set property(
					"spec limits",
					{LSL( __LSL__ ), USL( __USL__ ), Target( __Target__ ), Show Limits( 1 )}
				)
			),
		Expr( __LSL__ ), :LSL[5],
		Expr( __USL__ ), :USL[5],
		Expr( __Target__ ), :Target[5]
	)
);
Jim
AdamChoen
Community Trekker

Re: assigned spec limits from limits column

Hi,
Thanks for the solution for the original question.
I have another question regarding the same issue/example.
Can I create a smart column property or trend chart property so that when I create a trend chart using jsl the limits will be included.
I think there need to be something because I have value and limits in every row.
Thanks, Adam
0 Kudos
markschahl
Community Trekker

Re: assigned spec limits from limits column

Show Limits(1) - I was searching around the scripting guide yesterday on how do this to a bunch of columns. Thanks!
0 Kudos
AdamChoen
Community Trekker

Re: assigned spec limits from limits column

Not working for me,
Did you mean as in the example?

 

biv=Bivariate(
	Y( :VALUE ),
	X( :DATE ),
	By(
		:TEST
	)
);
biv << Show Limits(1);
Thanks, Adam
0 Kudos
markschahl
Community Trekker

Re: assigned spec limits from limits column

Adam:

 

My application was to be able to toggle the 'Show as graph reference lines' for Spec Limits. After doing Process Capability, loading spec limits from a table, then saving them to columm property I noticed that none of the columns had the 'Show as graph reference lines' checked. For 55 columns I did not want to do this manually (but I did - I searched the documentation but could find out how to do this). Now I have JSL that can do it. Change the (1) to a (0) to toggle. You want to see the Spec Limit lines for some plots, but not others.

  

Names Default To Here( 1 );
dt = Current Data Table();

mycols = dt << Get Column Names( string );

For( i = 2, i <= N Items( mycols ), i++,
Column( i ) << Set Property( "Spec Limits", {Show Limits(1)} );
);

 

So, this JSL will toggle the Show Limits(), but it will wipe out the LSL(), Target(), USL() assigned to the column. 

Does anyone out there have a way to only toggle the Show Limits()?

0 Kudos
txnelson
Super User

Re: assigned spec limits from limits column

Here is a simple script that will set the Show Limits without deleting the already set limits

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\Semiconductor Capability.jmp" );

mycols = dt << Get Column Names( numeric, string );

For( i = 1, i <= N Items( mycols ), i++,
	spec = Column( dt, mycols[i] ) << Get Property( "Spec Limits" );
	If( Is Empty( spec ) == 0,
		LSL = Try( spec["LSL"], . );
		USL = Try( spec["USL"], . );
		Target = Try( spec["Target"], . );
		Eval(
			Substitute(
					Expr(
						Column( dt, mycols[i] ) <<
						Set Property(
							"Spec Limits",
							{LSL( __LSL__ ), USL( __USL__ ),
							Target( __Target__ ), Show Limits( 1 )}
						),
					),
				Expr( __LSL__ ), LSL,
				Expr( __USL__ ), USL,
				Expr( __Target__ ), Target
			)
		);
	);
);
Jim
0 Kudos
markschahl
Community Trekker

Re: assigned spec limits from limits column

Jim:

 

Thanks! I now owe you two beers :).

One of these days I will have to confromt my fear of Eval / Expr / Substitute

0 Kudos
txnelson
Super User

Re: assigned spec limits from limits column

1 Single Malt Scotch == 2 Beers

Jim
0 Kudos
markschahl
Community Trekker

Re: assigned spec limits from limits column

Gladly! Ever had Ardbeg Uigeadail? Are you coming to Discovery 2018 in Cary?

0 Kudos