안녕하세요, 행별로 여러 제품에 대한 데이터가 포함된 일련의 열이 있습니다. 제품 이름 접미사가 있는 새로운 동일한 열을 생성하여 이 데이터를 분할하고 이전 열에서 일치하는 제품 데이터만 복사해야 합니다. 적절한 데이터를 복사하는 데 도움이 필요합니다. 선택 및 복사 붙여넣기를 사용하여 이 작업을 수행하려고 했지만 방법을 잘 모르겠습니다. 관심 영역은 굵게 + 밑줄로 표시됩니다.
Names Default To Here( 1 );
dt = Current Data Table();
colNames = dt << Get Column Names(String);
//Select set of columns to split
for (i = nitems(colNames), i > 0, i--,
if (!contains(colNames[i], "SPC"),
remove from(colNames, i);
);
);
//Add new columns with product name suffix and copy/paste properties
Summarize(unique_values=by(:Products));
colNames2=colNames;
for (k = nitems(unique_values), k > 0, k--,
for (i = nitems(colNames), i > 0, i--,
colNames2[i] = colNames[i] || " " || unique_values[k];
dt << New Column( colNames2[i] );
);
for( j = 1, j <= nitems(colNames), j++,
colProps = Column( dt, colNames[j] ) << Get Column Properties;
Column( dt, colNames2[j] ) << Add Column Properties( colProps );
);
<U><STRONG> dt << Select Where( :Products == unique_values[k] );
dt << selectColumns(colNames);
dt << Copy;
dt << selectColumns(colNames2);
dt << Paste;</STRONG></U>
);