I am trying to generalize splitting columns in a data table that can have any number of columns to split. I am identifying them by looking for the word "Parameter." I am doing something wrong in Step 3, I believe, when referecing SummaryMetricNames.
Thank you in advance!
//Step 1: Get the means of columns in ColList (select metric columns from a table I got using Get Column Names)
rd_summary = rd << Summary(
Group( :Participant Name, :Treatment ),
Mean( ColList),
Freq( "None" ),
Weight( "None" ),
statistics column name format( "column" )
);
//Step 2: Get list with just means columns from the table
SummaryMetricNames = rd_summary << Get Column Names;
For( i = N Items ( SummaryMetricNames ), i>=1, i--,
If ( Contains( SummaryMetricNames[i],"Parameter" )==0,
SummaryMetricNames = Remove( SummaryMetricNames, i, 1 )
)
);
//Step 3: Split data (this part is not working)
rd_split = rd_summary << Split(
Split By( :Treatment ),
Split( SummaryMetricNames),
Group( :Participant Name ),
Remaining Columns( Drop All ),
Sort by Column Property
);