こんにちは!
時間の経過とともに追加のデータを取得するデータセット(dt)があります。期間は、経過時間の列に日数としてリストされています。
私はすでにこのデータを取得し、それを分割して、:経過時間列の各新しい日が2番目のシートに新しい列を作成するようにしました。経過日数は時間とともに増加します。そのため、新しいシートの列数も増えます。データを収集しながらこのスクリプトを再実行して、時間の経過とともに傾向を確認できるようにすることを計画しています。
ただし、さまざまな経過時間と元の時間との違いを示す一連の列を作成する方法を理解することはできません。
//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日分のデータがあるので、sample = {0、1、2}となります。2つの新しい列、列 "1 day"と列 "2 day"を作成したいとします。それぞれの列には、その日のデータから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"))
);それが奇妙に貼り付けられたので^^スクリプトを修正しました