表腳本你好。我已經保存了一些在執行異常分析時想要使用的腳本。這些是健身模型腳本,我希望每次使用循環隱藏和排除值時都運行1個腳本。但是,我已按列名命名了腳本。因此,我希望腳本名稱與列名稱匹配並僅運行該腳本。我考慮了Linnerud示例數據的示例。
dt = current data table();
col = dt << get column names( string );
nc = N Items( col );
For( i = 1, i <= nc, i++,
If( Contains( ColNames[i], "Outlier" ),
Col1 = Column(dt,i);
max = data table(dt);
max << select where(as column(Col1)==abs(Col Max( Col1 ))) << Hide and Exclude;
//Hide and exclude the MAX val from Outlier 1 Rest Pulse, and Run Outlier 1 Rest Pulse script
//Run Script("Outlier 1 Rest Pulse");
)
);這可能嗎?
回复:表腳本是的,有可能。 以下是您代碼的更新。
Names default to here(1);
dt = Current Data Table();
col = dt << get column names( string );
nc = N Items( col );
For( i = 1, i <= nc, i++,
// Clear the Hide and Excludes from the last loop
dt << clear rowstates;
If( Contains( Col[i], "Outlier" ),
Col1 = Column( dt, i );
dt << select where( As Column( Col1 ) == Abs( Col Max( Col1 ) ) ) << Hide and Exclude;
//Hide and exclude the MAX val from Outlier 1 Rest Pulse, and Run Outlier 1 Rest Pulse script
//Run Script("Outlier 1 Rest Pulse");
)
// Make sure Auto Recalc is unselected in the platforms you run, since if it is active, all
// the platforms will recalcuate to new results each time the different Hide and Excludes are changed
);