한 테이블에서 다른 테이블로 열 복사(수식 및 제목 가져오기안녕. 나는 두 개의 테이블이 있습니다. 내가 필요로 하는 표제와 공식이 있는 것.
그리고 다른 테이블에는 공식이 있는 테이블이 있습니다. 어떻게 한 테이블의 열을 다른 테이블로 복사할 수 있습니까(수식 및 제목 가져오기). 감사
Re: 한 테이블에서 다른 테이블로 열 복사(공식과 제목 가져오기원본 게시물이 복사를 수행하기 위해 스크립트를 사용하여 말하고 있지 않은 경우 해야 할 일은 다음을 사용하는 것입니다.
테이블==>서브셋
아래는 스크립트의 보다 완전한 주석 버전입니다.
// This script creates a couple of example data tables and then runs
// a little script that copies all of the columns from the originating
// data table to a new data table
// Setup the memory environment
Names Default To Here( 1 );
// Create an example data table that has some formula columns
// The variable "dt" is used as a pointer to this data table
dt = New Table( "Source",
add rows( 20 ),
New Column( "A", formula( Random Integer( 1, 10 ) ) ),
New Column( "B", formula( Random Integer( 20, 30 ) ) )
);
dt << run formulas;
// Create a new data table that will be used to create the new
// columns in
// Variable "dt2" is used to point to this data table
dt2 = New Table( "Copy", add rows( 10 ) );
// Create the columns and set the names and formula
// Loop across all columns in the Originating data table
// and retireve the name and formula and then create a new
// column in the new data table
For( i = 1, i <= N Cols( dt ), i++,
// Create the new column in the new data table, giving it
// the name from the current data table
dt2 << New Column( Column( dt, i ) << get name );
// Get the formula from the originating data table
theFormula = Char( Column( dt, i ) << get formula );
// Set the formula into the new data table
Eval(
Parse(
"Column( dt2, Column( dt," || Char( i ) || ")<< get name ) <<
set formula( " || theFormula || ");"
)
);
);Re: 한 테이블에서 다른 테이블로 열 복사(공식과 제목 가져오기안녕하세요 감사합니다! 죄송하지만 스크립트를 이해할 수 없습니다. 다른 방법으로 설명해 주시겠습니까?Re: 한 테이블에서 다른 테이블로 열 복사(공식과 제목 가져오기다음은 이 작업을 수행하는 한 가지 방법의 예입니다.
Names Default To Here( 1 );
dt = New Table( "Source",
add rows( 20 ),
New Column( "A", formula( Random Integer( 1, 10 ) ) ),
New Column( "B", formula( Random Integer( 20, 30 ) ) )
);
dt << run formulas;
dt2 = New Table( "Copy", add rows( 10 ) );
// Create the columns and set the names and formula
For( i = 1, i <= N Cols( dt ), i++,
dt2 << New Column( Column( dt, i ) << get name );
theFormula = Char( Column( dt, i ) << get formula );
Eval(
Parse(
"Column( dt2, Column( dt," || Char( i ) || ")<< get name ) <<
set formula( " || theFormula || ");"
)
);
);