我嘗試在幫助指南中查找此內容,看起來我正確應用了它,但它似乎不起作用。 有人可以檢查一下我是否遺漏了什麼嗎?
我有一個從另一列創建的列並對值進行四捨五入。 我只需要保留基於新列中的值的行範圍。 我只想保留 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 );