Subscribe Bookmark RSS Feed

How to use variable in a dataset script

r23426

Community Trekker

Joined:

Jul 3, 2014

Hi,
I am using jsl script to analyse data, by generating small dataset which contains only a speciifc type of parameter with several

"calculation" based on these parameters ( some information extracted from parameter name and some calculation on parameter
values). My main analysis script adds then several scripts to the dataset to be able to plot scatter plot between variable, run OneWay

test, distribution.

Below is some extract of the distribution script:

dt << NewTableScript("Distribution",
Survival(
SendToByGroup( {:Meas_Type == "SHORT"} ),
Y( :Current ),
Grouping( :Split ),
Failure Plot( 1 ),
Show Points( 1 ),
Survival Plot( 0 ),
By( :Meas_Type ),
SendToByGroup(
{:Meas_Type == "SHORT"},
SendToReport(
Dispatch(
{"Product-Limit Survival Fit Meas_Type=SHORT", "Failure Plot"},
"1",
ScaleBox,
{Scale( "Log" ), Format( "Scientific", 10 ), Min( 0.0000000000001 ),
Max( 0.001 ), Inc( 1 ), Minor Ticks( 1 ),
Add Ref Line( 0.000000001, Solid, {255, 0, 0}, "USL", 2 )}
),
Dispatch(
{"Product-Limit Survival Fit Meas_Type=SHORT", "Failure Plot"},
"2",
ScaleBox,
{Min( -0.03 ), Max( 1.03 ), Inc( 0.2 ), Minor Ticks( 1 )}
),
Dispatch(
{"Product-Limit Survival Fit Meas_Type=SHORT", "Failure Plot"},
"Fail Plot",
FrameBox,
{Row Legend(
Split,
Color( 1 ),
Color Theme( "JMP Dark" ),
Marker( 0 ),
Marker Theme( "" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
)
)
),
SendToByGroup(
{:Meas_Type == "OPEN"},
etc.....

Until then the graph show limits lines ( generally the usual 3 LSL, USL and Target). The limits values are hard coded in the script, in other word, I have the number like 5.16 e-5 in the code: Add Ref Line( 0.0000516, Solid, {0, 0, 255}, "TGT", 2 ) .

So not easy to maintain for any limit change.....

I was wondering if there is a way to have this value defined by a variable that I can managed the value of this variable in my main

analysis script ?
And use something like that Add Ref Line( Target_parm_1, Solid, {0, 0, 255}, "TGT", 2 ), in the script added to the dataset.

1 ACCEPTED SOLUTION

Accepted Solutions
markbailey

Staff

Joined:

Jun 23, 2011

Solution

You can define the second argument to this function as an expression: distribution expr = Expr( Survival( ... ) in which you replace the specific values with placeholders. For example, LSL( LLL ). Use the Substitute() function to replace the placeholders (e.g., LLL) with the desired value.

Learn it once, use it forever!
2 REPLIES
markbailey

Staff

Joined:

Jun 23, 2011

Solution

You can define the second argument to this function as an expression: distribution expr = Expr( Survival( ... ) in which you replace the specific values with placeholders. For example, LSL( LLL ). Use the Substitute() function to replace the placeholders (e.g., LLL) with the desired value.

Learn it once, use it forever!
r23426

Community Trekker

Joined:

Jul 3, 2014

Hi, It works well.

and I use teh same approach to pass the variable value in adding column with formula.

Thanks.