cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

Discussions

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

Creating a new column from 2 columns with a formula

Hi,

 

Can someone help me write a code in JMP to recreate Column 3 in the attached file.

 

Column 3 was derived from columns 1 and 2. Basically if Column 1 is "PM01" and Column 2 is "A01" or "B01" or "C01" or "D01" or "E01" or "F01", then Column 3 will be "Lot 1" and so on.

 

Best,

Meda

9 REPLIES 9
jthi
Super User

Re: Creating a new column from 2 columns with a formula

Not really sure I can understand the logic you have in xlsx file. What do you do when the numbers don't match?

jthi_1-1640198379191.png

 

jthi_0-1640198193090.png

You can get last characters of string for example with Right()

Right("PM12", 2); //12

 

-Jarmo
Meda
Level I

Re: Creating a new column from 2 columns with a formula

I want to recreate Column 3 in jmp using columns 1 and 2

Meda
Level I

Re: Creating a new column from 2 columns with a formula

I used this formula and it works for Lot 1; but I don't know how to expand it for PM01 to PM12 and for Lot 2 and 3.

 

If(
	:Panel Member == "PM01" & :Well # == "A01" | :Panel Member == "PM01" & :Well # == "B01" | :Panel Member == "PM01" & :Well # == "C01" |
	:Panel Member == "PM01" & :Well # == "D01" | :Panel Member == "PM01" & :Well # == "E01" | :Panel Member == "PM01" & :Well # == "F01",
	"Lot 1",
	"TBD"
)

 

jthi
Super User

Re: Creating a new column from 2 columns with a formula

Based on this, I would say CC Lot# is determined only by Well#

jthi_0-1640202103812.png

 

-Jarmo
Meda
Level I

Re: Creating a new column from 2 columns with a formula

Ok, can you then write a formula to recreate column 3 by well#

jthi
Super User

Re: Creating a new column from 2 columns with a formula

Attachment in previous post (Sheet1.jmp) has one idea for it

-Jarmo
Meda
Level I

Re: Creating a new column from 2 columns with a formula

Ok I got it thank you so much!

frank_wang
Level IV

Re: Creating a new column from 2 columns with a formula

Hi Meda

Pls refer to annex files and click '+' after column check formula.

Have a nice day.

心若止水
arooqi
Level II

Re: Creating a new column from 2 columns with a formula

Since you have few levels of Lots, you can recode the data to a new column and JMP will create the formula for you.

Iraq Abdulwahhab

Recommended Articles