值排序-使用JSL设置列属性你好
我需要一些脚本建议,因为关于值排序的列属性从JMP14更改为JMP15-引入了“自定义顺序”
以下脚本在JMP 14中可以正常工作,并且可以在检查列属性时看到结果
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 )] ) );
上面的脚本可在JMP15中使用,但由于新的“自定义订单”,结果在列属性中不可见-我想是
有谁知道如何更改它以使其正常工作和在JMP15的列属性中可见的结果?
以下无效。
Summarize( g = by( :BatchVO ), m = Mean( :name("Timestamp") ) );
//JMP15 Script
:BatchVO << Set Property( "Value Order", {Custom Order(Eval( g[Rank Index( m )] ))} );关于适用于JMP15及更高版本的正确JSL脚本的任何想法吗?
@martindemel
数据表脚本编写回复:值排序-使用JSL设置列属性从“摘要”中为“ g”变量返回的值将作为字符串返回,并且您尝试将字符串值应用于数字列回复:值排序-使用JSL设置列属性非常感谢你。
现在,它在列属性菜单中可见-很好。回复:值排序-使用JSL设置列属性这个怎么样。我陷于规格限制的Set属性中。谢谢你的帮助
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);
);回复:值排序-使用JSL设置列属性在我注释掉“添加图形代码”行(您未包括dlgStatus对象)之后,您的代码对我的示例数据运行良好。 因此,如果它不适用于您的代码,我怀疑您的数据表中的列名称与spectable中的description列之间不匹配。
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 );
);回复:值排序-使用JSL设置列属性您能帮我吗..使用V13可以正常工作,但是当我升级到V15时,仍然提示设置规格限制时出错。
顺便说一句,此功能是使用第3至第5行作为规范合并2个或更多的csv文件。 谢谢!
回复:值排序-使用JSL设置列属性日志中的错误消息是什么?回复:值排序-使用JSL设置列属性您尝试将“规格限制”应用到的列是字符数据类型。您需要将其更改为数字。回复:值排序-使用JSL设置列属性请参阅附件错误消息。
