cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Image to Table JMP extension imports single or batch images as data tables. Useful to extract curves from pictures or convert image data to curve data to use in analyses like Functional Data Explorer. Download and install the extension.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
lala
Level IX

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 IX

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

Recommended Articles