当您在数据过滤器中选择一个项目时,我无法弄清楚如何进行“工作”。 当我选择一个条件时,我希望脚本转到我的限制表,然后填充我用于图形脚本的表达式。 这将根据数据过滤器中的“where”语句而改变。 我不知道如何让脚本触发此操作,或者如果我要更改为不同的数据过滤器选择,如何删除它。 我提前道歉,因为我没有完整的脚本或示例数据表。 如果需要更多信息,我会尽力获取一些。
谢谢
// Step 1: Go to the textbox with "Where" statement
Try( test = Report( gb1_S.2 )[Text Box( 5 )] << Get Text );
graph = dt_lim << Get Rows Where( Contains( test, :SPEC_COL_NAMES ) );
// Step 2: If a condition exists, populate the following
f1 = Column( dt_lim, "StartF" )[graph][1]; // x1 for a Marker and starting point for the line
f2 = Column( dt_lim, "StartF" )[graph][2]; // x2 for a Marker and starting point for the line
s1 = (Column( dt_lim, "LSL" )[graph])[1]; // y1 (LSL) for the Line
s2 = (Column( dt_lim, "USL" )[graph])[1]; // y2 (USL) for the Line
color = "Red";
test = Expr(
graph_expr = Eval Insert(
"\[Graph_Script = Expr(
Marker Size( 6 );
Marker( Marker State( 20 ), Color State( "^color^" ), {^f1^, ^s1^}, {^f2^, ^s2^} );
Pen Color( "^color^" );
Line( {^f1^, ^s1^}, {^f2^, ^s2^} );
)]\"
);
Eval( Parse( graph_expr ) );
);
<BR /><BR />// Step 3: Execute the Graphics script<BR /><BR />Report( gb1_S.2 )[Framebox( 1 )] << Add Graphics Script( Graph_Script );查看脚本索引中的“制作过滤器更改处理程序”,了解如何在更改过滤器选择时触发操作。
脚本索引示例:
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Cities.jmp");
dist = Distribution(Automatic Recalc(1), Continuous Distribution(Column(:POP)));
filter = dist << Local Data Filter(Add Filter(columns(:Region)));
f = Function({a}, Print(a));
rs = filter << Make Filter Change Handler(f);