cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Due to the recently reported Microsoft outage, users may be temporarily unable to access My JMP or experience a delay receiving their verification codes. If you have previously installed JMP on your computer, this outage should not impact your ability to access the software. My JMP services will be restored as soon as Microsoft resolves this issue.
  • 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