cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
Choose Language Hide Translation Bar
LGaspard
Level II

Overwrite data in a table

Hi, 

I am trying to clean up my data table. I have a table with some value which are "x", "X", "X-Direction", "X-direction", but they are all the same, which is "X". 

How can I change the values (in the script) so it overwrite everything with the same format ("X")?

 

Because then, I want to split my data table and it gives me 4 columns where I should have only 1... Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Overwrite data in a table

One option is to use Recode:

jthi_0-1675435695647.png

Select your values you wish to recode

jthi_1-1675435707072.png

Press Group

jthi_2-1675435722641.png

Select how you wish to recode them

jthi_3-1675435756678.png

And finally press Recode

Changed this:

jthi_4-1675435785188.png

to this

jthi_5-1675435796366.png

And if you have JMP16+ you can get the code from action recorder

// Recode column: Column 6
Local({dt},
	dt = Data Table("Big Class");
	dt << Begin Data Update;
	dt << Recode Column(
		dt:Column 6,
		{Map Value(
			_rcOrig,
			{"X-Direction", "X", "X-direction", "X", "x", "X"},
			Unmatched(_rcNow)
		)},
		Update Properties(1),
		Target Column(:Column 6)
	);
	dt << End Data Update;
);

Or from Recode menu before you press Recode

jthi_6-1675435840610.png

 

-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: Overwrite data in a table

One option is to use Recode:

jthi_0-1675435695647.png

Select your values you wish to recode

jthi_1-1675435707072.png

Press Group

jthi_2-1675435722641.png

Select how you wish to recode them

jthi_3-1675435756678.png

And finally press Recode

Changed this:

jthi_4-1675435785188.png

to this

jthi_5-1675435796366.png

And if you have JMP16+ you can get the code from action recorder

// Recode column: Column 6
Local({dt},
	dt = Data Table("Big Class");
	dt << Begin Data Update;
	dt << Recode Column(
		dt:Column 6,
		{Map Value(
			_rcOrig,
			{"X-Direction", "X", "X-direction", "X", "x", "X"},
			Unmatched(_rcNow)
		)},
		Update Properties(1),
		Target Column(:Column 6)
	);
	dt << End Data Update;
);

Or from Recode menu before you press Recode

jthi_6-1675435840610.png

 

-Jarmo
LGaspard
Level II

Re: Overwrite data in a table

It works!! Thanks :))