Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- How to use variable in a dataset script

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Nov 29, 2016 10:25 AM
(6684 views)

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

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 2

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

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!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: How to use variable in a dataset script

Hi, It works well.

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

Thanks.

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

Thanks.