- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Modify summary table
I am trying to modify a summary table.
-The table has been ordered by Sub_name, Substrate_ID and Date in that order.
-I want to search the table and if a Sub_name is a duplicate, a Substrate ID is a duplicate and the dates are within 1 day, then combine those rows.
-these values are ones that ran through midnight, so their dates are different, which causes them to be on seperate lines.
I tried the following code:
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,
);
);
Thanks for any help.
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Modify summary table
Created:
Apr 19, 2018 08:02 AM
| Last Modified: Apr 19, 2018 5:24 AM
(4594 views)
| Posted in reply to message from KST-CPT 04-19-2018
I think you can solve your issue very simply by using the Summary Platform for a second time
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 )
);
Jim
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Modify summary table
Created:
Apr 19, 2018 08:02 AM
| Last Modified: Apr 19, 2018 5:24 AM
(4595 views)
| Posted in reply to message from KST-CPT 04-19-2018
I think you can solve your issue very simply by using the Summary Platform for a second time
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 )
);
Jim