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)
);
La méthode que j'utilise probablement le plus souvent consiste à supprimer la formule d'une colonne créée à l'aide d'une formule.La suppression de la formule convertit la colonne en une colonne statique normale, en conservant toutes les valeurs.Vous pouvez ensuite apporter les modifications dont vous avez besoin à l'aide d'instructions d'affectation standard.
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 ) )
;