Hi guys.
Need your advice with the following.
I careted this loop that look for all Numeric columns that their name starts with "MEAS" (for measurement) and create a new statistic columns based on data in those columns grouped by runid data.
The loop is working but it takes ages to complete - any idea why? or what can be done to improve it?
Thx
dt_ncol=ncol(dt);
for(i=1,i<=dt_ncol,i++,
if(column(i)<<get data type=="Numeric" & substr(char(column name(1)),1,4)=="MEAS",
((dt<<new column(column name(i)||"_MEAN",
formula(col mean(as column(column name(i)),:runid))));
(dt<<new column(column name(i)||"_MAX",
formula(col max(as column(column name(i)),:runid))));
(dt<<new column(column name(i)||"_MIN",
formula(col min(as column(column name(i)),:runid)))))
,column(i)));