私は数千の列を、最初の列の値のリストの何かと一致する名前でグループ化する作業を行っています
例:
Col1 の値 = {step1、step2、step3}
Col2:5000 の名前:step1_blahblahblah、step2_blahblahblah など
Col1 の値のリストを使用する if(contain) ステートメントをどのように定義すればよいかよくわかりません。
dt = current data table();
Summarize( dt, StepIDIndex= by( :RecipeStepId) );//get list of unique RecipeStepID's
colNamesList = dt << get column names(string, continuous); //get all the column names
StepList = {}; //Create an empty list for the matching columns
// Find matching column names
For( i = 1, i <= N Items( colNamesList ), i++,
If(
contains( colNamesList[i], StepIDIndex),
Insert Into( StepList , colNamesList[i] )
)
);
// If groups of columns are found, create col groupings
If( N Items( StepList ) > 0,
dt<< select columns( StepList );
dt<< group columns();
);