cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
lala
Level VII

How can I set the value of a specified column to the displayed value, ignoring the original significant digit?

For example, make the actual values of the "new" column in table 2 all integers.

2023-01-15_09-58-02.png

dt=Open("$SAMPLE_DATA/Big Class.jmp");
d2=dt<<Summary(Group(:age),Mean(:height),Freq("None"),Weight("None"),Link to original data table(0));
Column(d2,3)<<Format("Fixed Dec",20,0);
d2<<New Column("new",formula(As Column(3)));d2<<run formulas;Column("new")<<deleteFormula;
2 REPLIES 2
txnelson
Super User

Re: How can I set the value of a specified column to the displayed value, ignoring the original significant digit?

All you have to do is to set the format for the column to something like

<< Format( "Fixed Dec", 6, 0 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
d2 = dt << Summary(
	Group( :age ),
	Mean( :height ),
	Freq( "None" ),
	Weight( "None" ),
	Link to original data table( 0 )
);
Column( d2, 3 ) << Format( "Fixed Dec", 20, 0 );
d2 << New Column( "new", formula( As Column( 3 ) ) );
d2 << run formulas;
Column( "new" ) << deleteFormula << Format( "Fixed Dec", 6, 0 );

txnelson_0-1673757456058.png

To capture the original format, and use it I found this method to work

Eval( Parse( "Column(d2,4) <<" || Char( column(dt,4) << get format ) || ";" ) );

 

Jim
lala
Level VII

Re: How can I set the value of a specified column to the displayed value, ignoring the original significant digit?

It seems that JMP does not have this feature and excel can implement this device.
The "new" column I added in the example simply checks that the precision of column 3 is an integer.

Thanks!

2023-01-15_13-45-17.png