集計表を変更しようとしています。
- テーブルは、Sub_name、Substrate_ID、Date の順に並べられています。
-テーブルを検索し、Sub_name が重複し、Substrate ID が重複し、日付が 1 日以内である場合、それらの行を結合したいと考えています。
- これらの値は午前 0 時までに実行されたものであるため、日付が異なるため、別の行に表示されます。
次のコードを試してみました。
debug = RTDT << Summary(Group( :Sub_name, :Substrate_ID, :Date ),
Mean( :Runtime ),
Freq( "None" ),
Weight( "None" ),
);
debug << Sort( By(:Sub_name, :Substrate_ID ), Order(Ascending), Replace Table);
EOL = Nrows(debug);
for(i=1, i < (EOL), i++, Formula(
if((debug:Substrate_ID[i+1] == debug:Substrate_ID[i]) &
(debug:Sub_name[i+1] == debug:Sub_name[i]) &
((debug:Date[i+1] - debug:Date[i]) == 86400),
NewCount = :N Rows[i]+:N Rows[i+1];
:N Rows[i+1] = New Count;
NewTime = column(debug|"Mean(Runtime)")[i] + column(debug|"Mean(Runtime)")[i+1];
column(debug|"Mean(Runtime)")[i+1] = NewTime;
debug << slect row(i) << delete row,
);
);
助けていただきありがとうございます。
まとめプラットフォームをもう一度使用すると、非常に簡単に問題を解決できると思います
Names Default To Here( 1 );
dt = Current Data Table();
dt << Summary(
Group( :Sub_name, :Substrate_ID ),
Max( :Date ),
Sum( :N Rows ),
Sum( :Name( "Mean(Runtime)" ) ),
Freq( "None" ),
Weight( "None" ),
statistics column name format( "column" ),
Link to original data table( 0 )
);