在数据集中订阅单元格大家好,
我试图在数据集中订阅一个单元格,但它从未奏效。例如,我想收到一条消息,即某些特定单元格的值被更改。这是一个例子:
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>