- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
How do I input a variable into "Historical Data End at Row" option for Multivariate Control Chart in JSL?
Hello.
This is taken from one of the Scripting Index script.
I was trying to write a JSL that essentially will have row_end as a dynamic input, but my current code below wouldn't work as intended.
How do I write it so that it can work? I've tried putting the whole expression into Eval (Eval Parse(Expression)) but that also did not work.
If I replace row_end with it's actual value, only then will my code work. Any ideas? Thanks.
I'm using JMP16.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Quality Control/Flight Delays.jmp" );
row_end = 16;
obj = dt << Model Driven Multivariate Control Chart( Process( :AA, :CO, :DL, :F9, :FL, :NW, :UA, :US, :WN ), Historical Data End at Row( row_end ) );
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How do I input a variable into "Historical Data End at Row" option for Multivariate Control Chart in JSL?
Created:
Dec 14, 2021 10:19 PM
| Last Modified: Dec 14, 2021 7:26 PM
(711 views)
| Posted in reply to message from Zahzul 12-14-2021
The "Historical Data End at Row()" appears to not be able to evaluate a variable. Therefore, one needs to handle that in JSL. A common way to do that is to use "Eval Insert()".
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Quality Control/Flight Delays.jmp" );
row_end = 16;
Eval(
Parse(
Eval Insert(
"obj = dt << Model Driven Multivariate Control Chart( Process( :AA, :CO, :DL, :F9, :FL, :NW, :UA, :US, :WN ), Historical Data End at Row( ^row_end^ ))"
)
)
);
Or, one could use a Substitute() function to handle the issue
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Quality Control/Flight Delays.jmp" );
row_end = 16;
Eval(
Substitute(
Expr(
obj = dt << Model Driven Multivariate Control Chart(
Process( :AA, :CO, :DL, :F9, :FL, :NW, :UA, :US, :WN ),
Historical Data End at Row( theEnd )
)
),
Expr( theEnd ), row_end
)
);
Jim