我尝试在帮助指南中查找此内容,看起来我正确应用了它,但它似乎不起作用。 有人可以检查一下我是否遗漏了什么吗?
我有一个从另一列创建的列并对值进行四舍五入。 我只需要保留基于新列中的值的行范围。 我只想保留 50000 到 50999 之间的新 Y 值,并删除其余行。
这是我的脚本中包含此命令的部分,但它不起作用。 您可以看到我正在处理的当前行之前的注释行正在工作,但现在可能还有 50000 范围内的其他值需要保留。
如果需要的话,我还附上了我的整个脚本作为参考。
dt = Current Data Table();
Column( dt, "X coordinate" ) << data type( Numeric ) << Modeling Type( Continuous ) << Format( Best, 12 );
dt << New Column( "New Y", Numeric, Nominal, Width( 5 ), Formula( Round( Y coordinate ) ) );
//dt << select where( :New Y != 50503 );
dt << select where( :New Y < 50000 & :New Y > 50999 );
dt << delete rows;
dt << New Column( "Normalized", Numeric, Continuous, Width( 10 ), Precision( 7 ), Formula( IntenCD / Col Max( IntenCD ) ) );
预先感谢您对此提供的任何帮助。
Clear Symbols();
Names Default To Here( 1 );
framex_value = "";
lotid_value = "";
w = New Window( "Requested Information", // opens a window with a title and this content...
<<RETURN result=""> 50999 );
dt << delete rows;
dt << New Column( "Normalized", Numeric, Continuous, Width( 10 ), Precision( 7 ), Formula( IntenCD / Col Max( IntenCD ) ) );
// Determine Matrix
xMat = Matrix( 76200 - (framex_value / 2) ) |/ Matrix( 76200 - (framex_value / 2) ) |/ Matrix( 76200 + (framex_value / 2) ) |/
Matrix( 76200 + (framex_value / 2) );
// The yMat is static
yMat = [1, 0.92, 0.92, 1];
// The overall delta
overallDelta = Col Max( dt:Normalized ) - Col Min( dt:Normalized );
//The delta between the lines
withinOrangeDelta = Col Max(
If( dt:X coordinate > (76200 - (framex_value / 2)) & dt:X coordinate < (76200 + (framex_value / 2)),
dt:Normalized,
.
)
) - Col Max( dt:Normalized ) - Col Min( dt:Normalized ) + 1;
Col Min( If( dt:X coordinate > (76200 - (framex_value / 2)) & dt:X coordinate < (76200 + (framex_value / 2)), dt:Normalized, . ) );
// Graph Builer and Delta display
gb = dt << Graph Builder(
Size( 534, 456 ),
Show Control Panel( 0 ),
Variables( X( dt:X Coordinate ), Y( dt:Normalized ) ),
Elements( Points( X, Y, Legend( 5 ) ) )
);
Report( gb )[FrameBox( 1 )] << Add Graphics Script(
Pen Color( "orange" );
Pen Size( 2 );
Line( xmat, ymat );
// Add the results to the chart
Text( Boxed, {75000, .94}, "Overall Delta = " || Char( Format( overallDelta, 7, 4 ) ) );
Text( Boxed, {75000, .93}, "Within Frame Delta = " || Char( Format( withinOrangeDelta, 7, 4 ) ) );
);
Report( gb )[AxisBox( 2 )] << Min( .91 );
Report( gb )<<SAVE picture=""></SAVE></RETURN>
这是您要使用的 SelectWhere() 子句
dt << select where( :New Y <= 50000 | :New Y >= 50999 );
你好,我仍然不知道如何删除除特定范围内的 Y 坐标之外的所有坐标。 根据之前帮助的更新,这是我正在处理的部分的新脚本。 所以我只需要保留从50000到50999的Y值,并删除其余的。
dt = Current Data Table();
Column( dt, "X coordinate" ) << data type( Numeric ) << Modeling Type( Continuous ) << Format( Best, 12 );
dt << New Column( "New Y", Numeric, Continuous, Width( 10 ), Formula( Round( Y coordinate, 0 ) ) );
//dt << select where( :New Y != 50503 );
dt << select where( 50000 <= :New Y <= 50999 );
dt << delete rows;
dt << New Column( "Normalized",
Numeric,
Continuous,
Width( 10 ),
Precision( 7 ),
Formula( IntenCD / Col Max( IntenCD ) )
);噢,伙计,谢谢。 这确实有道理。 我用该新行替换了我的代码,但它实际上仍然没有删除所有需要删除的其他行,因此我仅绘制 50000 到 50999 之间的新 Y 值。 我还能错过什么?
我认为这只是一个逻辑问题。
您的 select where 语句:
dt << select where( :New Y < 50000 & :New Y > 50999 );
永远不可能为真,因为:New Y 不能小于 50000和同时大于50999。
相反,您想要:
dt << select where( 50000 <= :New Y <= 50999 );