在數據集中訂閱單元格大家好,
我試圖在數據集中訂閱一個單元格,但它從未奏效。例如,我想收到一條消息,即某些特定單元格的值被更改。這是一個例子:
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
New Window( "Example",
TB=Table Box(
Data Table Col Box( :height )
)
);
TB<<SET cell="" changed="" function=""></SET>一旦我更改了“height”列中的值,數據表col框中的相應值將被chnaged。但是,值更改時警告窗口不會加速。基本上,我想從Subscribe()這樣的數據表接收一個/多個單元格的消息。任何想法都會得到滿足。
Re:訂閱數據集中的單元格這兩個解決方案很棒,適合我。再次感謝您的幫助,這對我幫助很大!Re:訂閱數據集中的單元格我喜歡!
Re:訂閱數據集中的單元格儘管在腳本索引中列出,但“設置單元格更改功能”似乎不適用於Data Table Col Box()。
這是一個關於數據表中兩個(隱藏)列的解決方法的想法。
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << New Column("orig_height", values(:height << get values), hide(1));
dt << New Column("on_change",
Formula(
If(height != orig_height,
New Window("Warning", Text Box("The cell value has been changed"));
.;
)
),
hide(1)
);
New Window("Example", Table Box(dtcb = Data Table Col Box(:height)));Re:訂閱數據集中的單元格我不知道無論如何直接觸發數據表中數據值的更改,然後讓它影響表格框中的更改()。 然而,下面是一個有點奇怪的解決方法,但它確實完成了工作.........我也希望JMP社區的另一個成員有更直接的方法來解決這個問題
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
// Setup a matrix of the current values
holdMatrix = dt:Height << Get Values;
// A Graphics Script will be triggered every time a
// graph changes.
// Therefore, it can be used to trigger a change in
// a data table
// Open a graph that will have a data point for every
// entry in the data table.
cc = Control Chart(
Sample Size( 1 ),
KSigma( 3 ),
Chart Col( :height, Run Chart( Show Center Line( 0 ) ) )
);
// The chart is not intended to be displayed, only used as
// a trigger. Therefore it needs to be hidden. If an
// "Invisible" element is added to the chart, the graphics
// trigger does not seem to work, however, if the "show window"
// message is sent, the Graphics Script continues to work
Report( cc ) << show window( 0 );
// Add a script to the Chart, to make the changes in
// the Table Box
Report( cc )[FrameBox( 1 )] << Add Graphics Script(
ncb << delete;
tb << append( ncb = Number Col Box( "string", dt:height << get values ) );
// If any value in the data tables Height column changes,
// this If statement will detect it
If( Min( holdMatrix == dt:height << get values ) == 0,
New Window( "Warning", Text Box( "The cell value has been changed" ), );
holdMatrix = dt:height << get values;
);
);
// Open the display window, with the desired table box
nw = New Window( "Example",
TB = Table Box(
ncb = Number Col Box( "string", dt:height << get values ),
)
);
// When the display window is closed, cleanup the
// environment by closing the trigger chart
nw << on close( Report( cc ) << close window );
Re:訂閱數據集中的單元格吉姆,嗨,
謝謝你的好主意。 但是,我試圖做與數據表col框相同的事情 - 一旦某個單元格的值發生變化,就會從數據表中鏈接一個值。因此,數據將直接更新到數據表而不是用戶的keyin。對困惑感到抱歉。
慈濟春
Re:訂閱數據集中的單元格問題似乎是您沒有為表格使用可編輯的Col Box()。 我已將您的Data Table Col Box()更改為Number Col Edit Box(),您現在指定的functionallity正常工作。
names default to here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
New Window( "Example",
TB=Table Box(
number Col Edit Box( "string",dt:height<<GET values=""></GET>