Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
ar2
ar2
Level II

Script For Adding Spec Limits to a column

I am new to scripting

I am sure this is very straightforward, but I am looking to create a script that adds an upper spec limit to a column (No USL or Target required)

Many thanks for any guidance

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
ian_jmp
Staff

Re: Script For Adding Spec Limits to a column

Here's one way:

NamesDefaultToHere(1);

// ******************************************************************************************
// Given a column reference, sets spec liomits property
// ******************************************************************************************
SetSpecLimits = function({c, lsl, usl, tar},
     cmd = Expr(c << SetProperty("Spec Limits", {LSL(expr(lsl)), USL(expr(usl)), Target(expr(tar))}));
     eval(evalexpr(cmd));
);

dt = Open("$SAMPLE_DATA/Big Class.jmp");
SetSpecLimits(Column(dt, "height"), 60, ., .);		// Set LSL only
SetSpecLimits(Column(dt, "weight"), 80, 120, 100);	// Set all three values

 Use 'Help > Scripting INdex' and 'Help > Books > Scripting Guide' to help figure out how it works.

View solution in original post

2 REPLIES 2
Highlighted
ian_jmp
Staff

Re: Script For Adding Spec Limits to a column

Here's one way:

NamesDefaultToHere(1);

// ******************************************************************************************
// Given a column reference, sets spec liomits property
// ******************************************************************************************
SetSpecLimits = function({c, lsl, usl, tar},
     cmd = Expr(c << SetProperty("Spec Limits", {LSL(expr(lsl)), USL(expr(usl)), Target(expr(tar))}));
     eval(evalexpr(cmd));
);

dt = Open("$SAMPLE_DATA/Big Class.jmp");
SetSpecLimits(Column(dt, "height"), 60, ., .);		// Set LSL only
SetSpecLimits(Column(dt, "weight"), 80, 120, 100);	// Set all three values

 Use 'Help > Scripting INdex' and 'Help > Books > Scripting Guide' to help figure out how it works.

View solution in original post

Highlighted
ar2
ar2
Level II

Re: Script For Adding Spec Limits to a column

Thanks Ian...I'll give it a go

 

Andrew

Article Labels

    There are no labels assigned to this post.