值排序 - 使用 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 )] ));