안녕하세요!
시간이 지남에 따라 추가 데이터를 얻는 데이터 세트 (dt)가 있습니다. 기간은 열에 일로 나열됩니다 (경과 시간).
이미이 데이터를 가져 와서 분할하여 : 경과 시간 열의 각 새 날짜가 두 번째 시트에 새 열을 생성합니다. 경과 된 날 수는 시간이 지남에 따라 증가 할 것입니다. 따라서 새 시트의 열 수가 증가합니다. 시간이 지남에 따라 추세를 볼 수 있도록 더 많은 데이터를 수집 할 때이 스크립트를 다시 실행할 계획입니다.
다양한 경과 시간과 원래 시간의 차이를 보여주는 일련의 열을 만드는 방법을 알아낼 수 없습니다.
//Taking the "dt" table and splitting the elapsed time column up into multiple columns in a new sheet <BR /><BR /><BR />straightness = dt << split(<BR /> Split by (:Elapsed Time ),<BR /> Split (:Straightness ),<BR /> Group (:Rod NUmber ),<BR /> Remaining columns (select (:Rod NUmber | :Type | :Location | :Study) ),<BR /> Output Table ("Straightness")<BR />);<BR /><BR />//Using the hidden "dt" table, we are figuring out which days exist as options in the "elapsed time" column <BR /><BR /><BR />summarize (dt, sample = by (:elapsed time) );
new columns = N Items (sample);<BR />
//In the new spreadsheet, where each of these days is a new column, this "for" loop should generate a new column for each non-zero elapsed time value<BR /> <BR /><BR />for( i=1, i<= new columns, i++, col = num(sample [i]);
straightness<< New Column (sample [i] || " Days", formula (eval(column (13+i+new columns)) - :Name("0"))
);
예를 들어, 현재는 3 일 분량의 데이터가 있으므로 샘플 = {0, 1, 2}입니다. 두 개의 새로운 열, "1 일"열 및 "2 일"열을 만들고 싶습니다. 각 열은 해당 일의 데이터에서 0 일째의 데이터를 뺀 값입니다.
그러나 내 데이터가 커지면서 더 많은 데이터 (예 : sample = {0, 1, 2, 3, 4, 5})가 있으면 5 개의 새로운 열을 만들고 각 데이터와 명명 스키마를 각각 만들려고합니다.
고맙습니다!!
//Taking the "dt" table and splitting the elapsed time column up into multiple columns in a new sheet
straightness = dt << split( Split by (:Elapsed Time ), Split (:Straightness ), Group (:Rod NUmber ), Remaining columns (select (:Rod NUmber | :Type | :Location | :Study) ), Output Table ("Straightness"));
//Using the hidden "dt" table, we are figuring out which days exist as options in the "elapsed time" column
summarize (dt, sample = by (:elapsed time) );
new columns = N Items (sample);
//In the new spreadsheet, where each of these days is a new column, this "for" loop should generate a new column for each non-zero elapsed time value<BR /><BR />for( i=1, i<= new columns, i++, col = num(sample [i]);
straightness<< New Column (sample [i] || " Days", formula (eval(column (13+i+new columns)) - :Name("0"))
);^^ 스크립트가 이상하게 붙여 졌으므로 스크립트가 수정되었습니다.