cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
‘New to using JMP? Hit the ground running with the Early User Edition of Discovery Summit – register now, free of charge.
Register for our Discovery Summit 2024 conference, Oct. 21-24, where you’ll learn, connect, and be inspired.
Choose Language Hide Translation Bar
TonyS
Level I

data cleanup, merge data from 3 columns into one column

HI Newbie here, I need some help to merge the data from 3 columns into one column, the data were collected in different time and by different person, and in 3 columns, so there are some missing data, some matched, like this:

 

A  B  C  

1  1  

0      0

1      1

 

How do I merge the data in A, B, C columns into one column in JMP?

Thank you so much for helping!

2 ACCEPTED SOLUTIONS

Accepted Solutions
txnelson
Super User

Re: data cleanup, merge data from 3 columns into one column

The formula for a new column that contains the single matched value would be

substring( trim(:A || :B || :C), 1, 1 )

Concatenate the 3 columns together, and then take the first character

Jim

View solution in original post

jthi
Super User

Re: data cleanup, merge data from 3 columns into one column

If you are sure you won't have any empty rows (or if you have empty row it will be coded as 0):

 

If(
	Contains(:A || :B || :C, "1"), "1",
	"0"
)

jthi_0-1633710489130.png

 

Also with JMP Missing is not same as "0". With the characters the Missing value would be empty string ("") and with numeric values it would be period (.) and sometimes this has to be taken into account.

 

 

Show(Ismissing(""));
Show(IsMissing(.));

 

 

-Jarmo

View solution in original post

6 REPLIES 6
jthi
Super User

Re: data cleanup, merge data from 3 columns into one column

How would you like to combine them? Sum of them? Concatenate them together? For example to sum them you could create new formula column with following formula:

Sum(:A, :B, :C)

To concatenate (character data), select all columns, right click on one of them and:

jthi_1-1633708945598.png

Or select all of them, Cols / Utilities / Combine Columns:

jthi_2-1633708986081.png

 

 

-Jarmo
txnelson
Super User

Re: data cleanup, merge data from 3 columns into one column

Are the columns numeric or character?

Given the above example, what is your expectation of what the final column will contain?

 

1

0

1

 

or

 

11

0 0

1 1

 

or

 

11

00

11

Jim
TonyS
Level I

Re: data cleanup, merge data from 3 columns into one column

Thanks txnelson and jthi, the columns are character, I need them to be either 1 or 0, the data in the 3 columns are either match or missing, so I just need to aggregate them together. 

Much appreciated!!

txnelson
Super User

Re: data cleanup, merge data from 3 columns into one column

The formula for a new column that contains the single matched value would be

substring( trim(:A || :B || :C), 1, 1 )

Concatenate the 3 columns together, and then take the first character

Jim
jthi
Super User

Re: data cleanup, merge data from 3 columns into one column

If you are sure you won't have any empty rows (or if you have empty row it will be coded as 0):

 

If(
	Contains(:A || :B || :C, "1"), "1",
	"0"
)

jthi_0-1633710489130.png

 

Also with JMP Missing is not same as "0". With the characters the Missing value would be empty string ("") and with numeric values it would be period (.) and sometimes this has to be taken into account.

 

 

Show(Ismissing(""));
Show(IsMissing(.));

 

 

-Jarmo
TonyS
Level I

Re: data cleanup, merge data from 3 columns into one column

Thanks!!!