我嘗試通過按下面的JSL來匹配最後一個“ ID”的數據。如何更改它以匹配第一個“ ID”的數據?
dt = Open( "$SAMPLE_DATA\Pizza Combined No Choice.jmp" );"
d2 = Open("$SAMPLE_DATA\Pizza Profiles.jmp");
dt<<UPDATE></UPDATE>達到如下所示的效果,謝謝!

你好 @ lwx228
請查看以下解決方案。我不是很健壯,但在這種情況下,它可以解決問題。
dt = Open( "$SAMPLE_DATA\Pizza Combined No Choice.jmp" );
d2 = Open( "$SAMPLE_DATA\Pizza Profiles.jmp" );
d2 << New Column( "Crustindex",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( If( :Crust != Lag( :Crust, 1 ) | Row() == 1, 1, Lag( :Crustindex, 1 ) + 1 ) )
);
d2:Crustindex << delete formula;
d2 << Sort( By( :Crust, :Crustindex ), Order( Ascending, Descending ), replace table );<BR />Wait( 0 );
dt << Update( With( d2 ), Match Columns( :Crust = :Crust ), Add Columns from Update table( :ID ) );
請告訴我們是否有幫助。
羅恩
就個人而言,如果我的數據又大又亂,我將完全從d2中過濾掉不需要的行。只有這樣,我才知道我想要更新。