使用變量作為列名這應該是一個非常簡單的問題,但它已經讓我沮喪了幾個小時,我無法弄清楚。我有一個腳本,它循環遍歷列列表並為每個列構建各種圖表。它還使用這行代碼將分佈添加到陣容框中。
當我手動輸入列名稱時,此行完美運行:
lub << append( Panel Box( "Distribution", db_Data << Distribution( Continuous Distribution( column( "VF (19)" )) ) ) );
但是當我嘗試使用變量時這將不起作用:
TestName = "VF (19)";
lub << append( Panel Box( "Distribution", db_Data << Distribution( Continuous Distribution( column( TestName )) ) ) );
我嘗試過使用
as column(TestName)
column( name(TestName))
column( as name(TestName))<BR />column( as :Name(TestName))<BR />column( :Name(TestName))
以及我可以在互聯網上的討論中找到的所有其他組合。但無濟於事。有人可以幫忙嗎?
高級統計建模自動化和腳本編寫消費者和市場研究數據混合和清理數據探索和可視化回复:使用變量作為列名我嘗試了這個解決方案,但它對我不起作用。
我做了什麼:
strTitle1 = "Process Capability of " || Eval( Eval Expr( Expr( limits[1] ) ) ) || " - " ||
station || " - " || Eval( Eval Expr( Expr( limits[7] ) ) );
strCol = Eval( Eval Expr( Expr( limits[1] ) ) );
dt1 << New Script(
strTitle1,
Distribution(
Stack( 1 ),
Continuous Distribution(
Column( Column( strCol ) ),
Quantiles( 0 ),
Horizontal Layout( 1 ),
Vertical( 0 ),
Show Counts( 1 ),
Process Capability(
Use Column Property Specs,
Process Capability Analysis(
Overall Sigma Capability( 0 ),
Histogram( 1, Show Overall Sigma Density( 0 ) )
)
)
)
)
);
我最終得到的是:
min_detection_probability 的處理能力 - XX - XX
Distribution(
Stack( 1 ),
Continuous Distribution(
Column( Column( strCol ) ),
Quantiles( 0 ),
Horizontal Layout( 1 ),
Vertical( 0 ),
Show Counts( 1 ),
Process Capability(
Use Column Property Specs,
Process Capability Analysis(
Overall Sigma Capability( 0 ),
Histogram( 1, Show Overall Sigma Density( 0 ) )
)
)
)
)
誰能告訴我我哪裡錯了?
回复:使用變量作為列名謝謝,成功了!回复:使用變量作為列名有一個名為 Column() 的函數,並且分發平台中還有一個名為 Column() 的元素。當您使用 TestName 作為參考時,JMP 會解釋
Column( TestName )
作為 Column() 函數,因此不存在 Column 元素。將語法更改為
TestName = "VF (19)";
lub << append( Panel Box( "Distribution", db_Data << Distribution( Continuous Distribution( column( column( TestName ))) ) ) );
它會起作用的