value ordering - using JSL to set column propertiesHi
I need some scripting advice as there were changes in the column properties from JMP14 to JMP15 regarding the value ordering - introducing "custom order"
The following script works fine in JMP 14 and the result can be seen checking the column properties
Summarize( g = by( :BatchVO ), m = Mean( :name("Timestamp") ) );
// JMP 14 Script for value ordering column "BatchVO" in the Order of the values in column "Timestamp"
:BatchVO << Set Property( "Value Ordering", Eval( g[Rank Index( m )] ) );
The script above works in JMP15 but the result is not visible in the column properties - I guess - due to the new "custom order"
Does anyone knows how to change this to get it working and the result visible in the column properties in JMP15?
The following does not work.
Summarize( g = by( :BatchVO ), m = Mean( :name("Timestamp") ) );
//JMP15 Script
:BatchVO << Set Property( "Value Order", {Custom Order(Eval( g[Rank Index( m )] ))} );Any ideas about the correct JSL script for JMP15 and above?
@martindemel
Data TableScriptingRe: value ordering - using JSL to set column propertiesThe values returned from your Summarize for the "g" variable are returned as character strings, and you are attempting to apply character string values to a numeric columnRe: value ordering - using JSL to set column propertiesThank you very much.
Now it is visible in the column properties menu - great.Re: value ordering - using JSL to set column propertiesHow about this one. I'm stuck in Set Property for Spec Limits. Thanks for your help
for (r = 1, r <= N Rows(spectable), r++,
specname = spectable:Description[r];
try(
dtcol = Column(datatable, specname);
,
//write("No data for \!"" || specname|| "\!"");
Continue()
);
//write("Setting spec for \!"" || specname|| "\!"\!r");
if(not(ismissing(spectable:LSL[r])) | not(ismissing(spectable:USL[r])),
eval(substitute(expr(dtcol << Set Property("Spec Limits", {LSL(_L), USL(_U), Show Limits(1)})),
expr(_L), spectable:LSL[r],
expr(_U), spectable:USL[r]
));
);
if(spectable:Units[r] != "",
eval(substitute(expr(dtcol << Set Property("Units", _U)),
expr(_U), spectable:Units[r]
));
);
progress = floor((r / N Rows(spectable)) * 100);
dlgStatus[FrameBox(1)] << Add Graphics Script({Fill Color("blue"),Rect(0,1,progress,0,1)});
wait(0.001);
);Re: value ordering - using JSL to set column propertiesAfter I commented out your Add Graphics Code line(you did not include the dlgStatus object) your code worked fine for my sample data. So if it does not work for your code, I suspect there is a mismatch between the name of the columns in your datatable and the description column in your spectable.
Names Default To Here( 1 );
datatable = Open( "$SAMPLE_DATA/big class.jmp" );
spectable = New Table( "specs",
Add Rows( 2 ),
New Column( "Description", Character, "Nominal", Set Values( {"height", "weight"} ) ),
New Column( "LSL", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [52, 61] ) ),
New Column( "USL", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [70, 175] ) ),
New Column( "Units", Character, "Nominal", Set Values( {"Inches", "Pounds"} ), Set Display Width( 56 ) )
);
For( r = 1, r <= N Rows( spectable ), r++,
specname = spectable:Description[r];
Try(
dtcol = Column( datatable, specname ),
//write("No data for \!"" || specname|| "\!"");
Continue()
);
//write("Setting spec for \!"" || specname|| "\!"\!r");
If( Not( Is Missing( spectable:LSL[r] ) ) | Not( Is Missing( spectable:USL[r] ) ),
Eval(
Substitute(
Expr(
dtcol << Set Property( "Spec Limits", {LSL( _L ), USL( _U ), Show Limits( 1 )} )
),
Expr( _L ), spectable:LSL[r],
Expr( _U ), spectable:USL[r]
)
)
);
If( spectable:Units[r] != "",
Eval( Substitute( Expr( dtcol << Set Property( "Units", _U ) ), Expr( _U ), spectable:Units[r] ) )
);
progress = Floor( (r / N Rows( spectable )) * 100 );
//dlgStatus[FrameBox( 1 )] << Add Graphics Script( {Fill Color( "blue" ), Rect( 0, 1, progress, 0, 1 )} );
Wait( 0.001 );
);Re: value ordering - using JSL to set column propertiesCan you help me on this.. it is working fine using V13 but when I upgrade to V15 still prompt an error in setting specs limits.
btw, function of this is to merge 2 or more csv file using 3rd to 5th row as specs. Thanks!
Re: value ordering - using JSL to set column propertiesWhat is the error message in the log?Re: value ordering - using JSL to set column propertiesThe column that you are trying to apply Spec Limits to is of a character data type., You need to change it to numeric.Re: value ordering - using JSL to set column propertiesSee attached error message.
