cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
mikedriscoll
Level VI

How do I remove a column formula but retain the values (without scripting)

Hi, How do I remove a column formula but retain the values (without scripting)? I remember seeing an answer to this several months ago, maybe at the JMP summit, but I've forgotten and can't seem to figure it out.

Thanks,

Mike

1 ACCEPTED SOLUTION

Accepted Solutions
ms
Super User (Alumni) ms
Super User (Alumni)

Re: How do I remove a column formula but retain the values (without scripting)

Just remove the Formula column property. Values will be retained (as I remember it...).

Right-click on the column header and pick Column Info. There should be a list of properties. Select Formula and click the remove button.

View solution in original post

10 REPLIES 10
ms
Super User (Alumni) ms
Super User (Alumni)

Re: How do I remove a column formula but retain the values (without scripting)

Just remove the Formula column property. Values will be retained (as I remember it...).

Right-click on the column header and pick Column Info. There should be a list of properties. Select Formula and click the remove button.

mikedriscoll
Level VI

Re: How do I remove a column formula but retain the values (without scripting)

Thanks. That worked.  I knew it was something simple, but couldn't remember it.

DonHil
Level I

Re: How do I remove a column formula but retain the values (without scripting)

Can you answer this same question except using scripting?  I need to use a formula on a column, get a value, but not store the formula.

txnelson
Super User

Re: How do I remove a column formula but retain the values (without scripting)

col << delete formula;

Documentation for all of these kind of items is available at

     Help==>Scripting Index

Jim

Re: How do I remove a column formula but retain the values (without scripting)

Or you could go without using a formula at all such as this:

dt<<New Column("Y",
<<Set Each Value(10+3*:x)
);

Of course that does depend on how complicated your formula is.

Dan Obermiller
DonHil
Level I

Re: How do I remove a column formula but retain the values (without scripting)

This works:

dt<<);

Now: Does anyone know how to replace the "dots" in the column with "0's" without using a formula?






txnelson
Super User

Re: How do I remove a column formula but retain the values (without scripting)

I assume that when you are referring to "dots" that you are referencing the Missing Value character.  Interactively, the easiest way to replace all of the Missing Values is to paste a "0" (zero) into all of the cells.  The following steps will do that:

1. Go to one of the cells that has a missing value, and select the cell by clicking on it.

2. Enter into the cell a zero.

3. Copy the zero character into the paste buffer by selecting the cell and the right clicking and selecting "copy"

4. Go to a new cell for the same column that has a Missing Value and click on the cell.

5. Right click on the cell and select "Select Matching Cells"

6. Right click once again on the same cell, and select "Paste"

A zero "0" will then be pasted into all cells for that column that were Missing Values.

 

Or, you can use Recode

1. Click on the column header to select the column

2. Go to the pull down menu (or one of the column based red triangles) and select

     Cols==>Recode

3. Change the Missing Value displayed to a zero

4. Click on "Done"

5. Select "In Place"

 

 

To do the same action using JSL, the following script will work:

Names Default To Here( 1 );
dt = Current Data Table();
columnVector = dt << get rows where( Is Missing( dt:your column name ) == 1 );
dt:your column name[columnVector] = 0;

 

Jim
DonHil
Level I

Re: How do I remove a column formula but retain the values (with scripting)

I'm trying to delete a column in JMP. However, the column to be deleted is used by another column in a formula. I can't find the syntax to remove the formula when I delete the column. Any ideas how to accomplish this would be appreciated. I have tried several things with no success:


col << Go To( :PC50);
Column("PC50") << delete formula;
dt <

col << Go To( :PC50);
Col ("PC50") << delete formula;
dt <

col << Go To( :"PC50");
Col("PC50") << delete formula;
dt <
col << Go To( :PC50);
col(:PC50) << delete formula;
dt <


and on and on...


What am I missing?




txnelson
Super User

Re: How do I remove a column formula but retain the values (with scripting)

Here is an example of how to delete a column that is being referenced in the formula of another column.

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\big class.jmp" );
dt << New Column( "LogHeight", formula( Log( :Height ) ) );

// Delete the formula in the column LogHeight
Column( "LogHeight" ) << delete formula;
dt << delete columns( "Height" );
Jim