cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Image to Table JMP extension imports single or batch images as data tables. Useful to extract curves from pictures or convert image data to curve data to use in analyses like Functional Data Explorer. Download and install the extension.

Discussions

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

Copying Row values to other Column

Hello,

 

Kindly help me I'm stuck when putting a formula into other column.

Here is expected output if SerialNumber is not empty copy row to Column ChipID else copy the same SN.

Capture.PNG

dtraw << New Column("ChipID", Character, Formula(
For( i = 1, i <= N Rows(dtraw), i++,
	If( Is Missing( :SerialNumber),
		:ChipID[i] = (:SerialNumber[1] & i = 1),
		:SerialNumber
		)
	)
);

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Copying Row values to other Column

Here is my way of handling the issue

dtraw << New Column( "ChipID",
	Character,
	Formula(
		If( :SerialNumber != "",
			hold = :SerialNumber
		);
		hold;
	)
);
Jim

View solution in original post

2 REPLIES 2
jthi
Super User

Re: Copying Row values to other Column

You can use Lag() function here.

 

Names Default To Here(1);

dt = New Table("Untitled 6",
	Add Rows(6),
	New Column("SerialNumber", Character, "Nominal", Set Values({"30_A0_0", "", "", "30_A0_01", "", ""}))
);
dt << New Column("ChipID", Character, Nominal, Formula(If(Is Missing(:SerialNumber), Lag(:ChipID), :SerialNumber)));
-Jarmo
txnelson
Super User

Re: Copying Row values to other Column

Here is my way of handling the issue

dtraw << New Column( "ChipID",
	Character,
	Formula(
		If( :SerialNumber != "",
			hold = :SerialNumber
		);
		hold;
	)
);
Jim

Recommended Articles