I have modified the script shared earlier by one of the contributors (thank you) so that the user can choose which data file (.jmp) file to open:
Names Default To Here( 1 );
// Open a dialog to choose a .jmp file to open
// Get the filename of the .jmp file to open
dt = Pick File("Select a .jmp file to open", "", {"JMP Files|jmp;jsl;jrn", "All Files|*"}, 1, 0, "");
// If the user did not select a file, exit the script
If( Is Missing( dt ),
Throw(),
// Else Open the selected file
Open( dt )
);
// Get all of the numeric column's names
colNameList = dt << get column names( string, continuous );
// Take the data from rows 1 & 2 and create the Spec Limits column property
For Each( {col}, colNameList,
Eval(
Substitute(
Expr(
Column( dt, col ) << set property(
"Spec Limits",
{LSL( _LSL_ ), USL( _USL_ ), Show Limits( 1 )}
)
),
Expr( _LSL_ ), As Column( dt, col )[1],
Expr( _USL_ ), As Column( dt, col )[2]
)
)
);
// Exclude and Hide row 1 & 2 to eliminate them from Distributions
dt << Select rows( {1,2} );
dt << hide and exclude;
// Run the Distribution Platform
dt << Distribution( column( eval(colNameList) ));
When running the script, I ran into the following error:
Send Expects Scriptable Object in access or evaluation of 'Send' , dt << /*###*/get column names( string, continuous ) /*###*/
It seemed there is a problem with the dt << get columns names?
I have also attached a copy of the data file which I would like to process. 1st and 2 rows of data are the LSL and USL respectively, which I do not want to be included as part of the data. But rather they are used to plot the LSL and USL lines in the Distribution graph.
Appreciate any help from the community. Thank you!