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

How to multiply column values without creating another column?

I have a column with decimal values that needs to be multiplied by 100. Is there other ways to do it without creating another column with formula? Is it possible to do it on the same column?

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: How to multiply column values without creating another column?

The easiest way to do this is to write a little script.  If the name of your column that you want to change is called "The Column", the following script will 

For Each Row( :The Column = :The Column * 100 );
Jim

View solution in original post

4 REPLIES 4
txnelson
Super User

Re: How to multiply column values without creating another column?

The easiest way to do this is to write a little script.  If the name of your column that you want to change is called "The Column", the following script will 

For Each Row( :The Column = :The Column * 100 );
Jim
UserID16644
Level V

Re: How to multiply column values without creating another column?

I tried re-creating this with a For Loop, but doesn't work.

 

dtcols = {"Score1", "Score2"};

For( i = 1, i <= N items (dtcols), i++,
	For Each Row( dtcols[i] = dtcols[i] * 100 );
);
txnelson
Super User

Re: How to multiply column values without creating another column?

You need to tell JMP the element from the list is a column.

dtcols = {"Score1", "Score2"};

For( i = 1, i <= N Items( dtcols ), i++,
	For Each Row( As Column( dtcols[i] ) = As Column( dtcols[i] ) * 100 )
);

BTW, a simpler form to use is with a For Each() function

For Each( {col}, dtcols,
	For Each Row( As Column( col ) = As Column( col ) * 100 )
);
Jim
UserID16644
Level V

Re: How to multiply column values without creating another column?

Thank you! I'm learning a lot ^^