Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
New Column( "Compare", Numeric, "Continuous", Format( "Percent", 12, 0 ), Formula( :weight / :height ) );
//change the value on position of :weight[2] to 59. But seems not work. could you help edit the script on this place?
dt:weight[2] << Set Values( 58 );
// I hope realize if the column "compare" result >100%, then output 100%, if <100% then keep the value no change. then how to edit script below? If( :Compare>100%,100%, no change);
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
New Column( "Compare",
Numeric,
"Continuous",
Format( "Percent", 12, 0 ),
Formula( :weight / :height )
);
// Changing the 2nd rows value for Weight to 59 will work with
// a simple assignment statement
dt:weight[2] = 59;
// One can not change a cell in a formula column,
// unless you change the complete formula
dt:compare << set formula(
:weight / :height;
if( :weight / :height > 1, 1)
);
아마도 내가 가장 자주 사용하는 방법은 수식을 사용하여 만든 열에서 수식을 삭제하는 것입니다.수식을 삭제하면 열이 모든 값을 유지하면서 일반 정적 열로 변환됩니다.그런 다음 표준 대입문을 사용하여 필요한 사항만 변경할 수 있습니다.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
New Column( "ratio",
Numeric,
"Continuous",
Format( "Percent", 12, 0 ),
Formula( :weight / :height )
);
dt << run formulas;
dt:ratio << delete formula;
For Each Row( If( :ratio > 1, :ratio = 1 ) )
;