值排序 - 使用 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 脚本有什么想法吗?
@马丁德梅尔
自动化和脚本编写回复:值排序 - 使用 JSL 设置列属性图1

图2

回复:值排序 - 使用 JSL 设置列属性嗨,吉姆,我正在处理脚本中值排序格式的类似问题;我需要能够取消选中客户订单并将其保留在每个数据表的行订单级别中。非常感谢你的帮助
这是脚本部分,我在其中选择要堆叠的列。
dt = Current Data Table();
dt1 = Data Table( dt ) << Stack(
columns( :Data Target, :Data1, :Data2, :Data3, :Data4, :Data5, :Best Data, ),
Source Label Column( "Label" ),
Stacked Data Column( "Data" ),
Drop All Other Columns( 1 ),
);
当我运行脚本时,我得到了按字母顺序排列数据的图表,请参见 pic1,其中左侧显示最佳数据
我想以这样的方式获得价值顺序
1)我可以取消选择客户订单框
2) 检查行顺序级别
这样,图表在堆栈表中的顺序与图 2 相同,其中数据目标位于图表的最左侧。
谢谢
山姆
回复:值排序 - 使用 JSL 设置列属性您尝试应用规格限制的列属于字符数据类型。 您需要将其更改为数字。回复:值排序 - 使用 JSL 设置列属性请参阅随附的错误消息。

回复:值排序 - 使用 JSL 设置列属性日志中的错误信息是什么?回复:值排序 - 使用 JSL 设置列属性你能帮我解决这个问题吗?使用 V13 工作正常,但当我升级到 V15 时,仍然提示设置规格限制时出错。
顺便说一句,它的功能是使用第 3 到第 5 行作为规格来合并 2 个或更多 csv 文件。 谢谢!
回复:值排序 - 使用 JSL 设置列属性在我注释掉您的“添加图形代码”行(您没有包含 dlgStatus 对象)之后,您的代码对于我的示例数据运行良好。因此,如果它不适用于您的代码,我怀疑您的数据表中的列名称与您的 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 );
);回复:值排序 - 使用 JSL 设置列属性这个怎么样。 我陷入了“设置规格限制属性”的困境。 感谢您的帮助
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 设置列属性非常感谢。
现在它在列属性菜单中可见 - 太棒了。回复:值排序 - 使用 JSL 设置列属性从“g”变量的 Summarize 返回的值以字符串形式返回,并且您正在尝试将字符串值应用到数字列
下面的代码似乎可以实现您想要的功能
names default to here(1);
Summarize( g = by( :BatchVO ), m = Mean( :name("Timestamp") ) );
for(i=1,i<=nitems(g),i++,
g[i]=num(g[i])
);
//JMP15 Script
eval(substitute(expr(:BatchVO << Set Property( "Value Order", {Custom Order(__list__)} );),
expr(__list__), g[Rank Index( m )] ));