초기 열의 값 목록에 있는 항목과 일치하는 이름으로 수천 개의 열을 그룹화하는 중입니다.
예:
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();
);