cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • DownloadSemiconductor Toolkit: Tools to create wafer maps, add wafer geometry to graphics, explore die defects & compare wafers.
  • Discovery Summit 2026: Early User Edition - September 23-24.Register. It's free.
  • See how to design an experiment, explore factor-response relationships, assess tradeoffs, and ID best settings. Register for Sep. 11 Mastering JMP.

Discussions

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

Add a column with a column name where last data is available.

ConfidenceOwl94_0-1756165014522.png

How can I add failure column with a column name from where test data start missing?

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
txnelson
Super User

Re: Add a column with a column name where last data is available.

Here is the formula I cam up with

As Constant(
	firstCol = 3;
	nTests = 5;
	lastCol = (firstCol + nTests) - 1;
	dt = Current Data Table();
);
nPass = Length( Loc( dt[Row(), Index( firstCol, lastCol )] ) );
If( nPass == 5,
	x = "Pass",
	x = Column( (firstCol + nPass) - 1 ) << get name
);
x;

txnelson_0-1756174500483.png

 

Jim

View solution in original post

jthi
Super User

Re: Add a column with a column name where last data is available.

Other option

Names Default To Here(1);

dt = Data Table("Untitled");

dt << New Column("Col", Character, Nominal);

test_cols = Filter Each({colname}, dt << Get Column Names("Continuous", "String"), Starts With(colname, "Test "));

For Each Row(dt,
	idx = Max(Loc(dt[Row(), test_cols]));
	If(idx >= N Items(test_cols),
		:Col = "Pass"
	,
		:Col = test_cols[idx];
	);
);
-Jarmo

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: Add a column with a column name where last data is available.

Here is the formula I cam up with

As Constant(
	firstCol = 3;
	nTests = 5;
	lastCol = (firstCol + nTests) - 1;
	dt = Current Data Table();
);
nPass = Length( Loc( dt[Row(), Index( firstCol, lastCol )] ) );
If( nPass == 5,
	x = "Pass",
	x = Column( (firstCol + nPass) - 1 ) << get name
);
x;

txnelson_0-1756174500483.png

 

Jim
jthi
Super User

Re: Add a column with a column name where last data is available.

Other option

Names Default To Here(1);

dt = Data Table("Untitled");

dt << New Column("Col", Character, Nominal);

test_cols = Filter Each({colname}, dt << Get Column Names("Continuous", "String"), Starts With(colname, "Test "));

For Each Row(dt,
	idx = Max(Loc(dt[Row(), test_cols]));
	If(idx >= N Items(test_cols),
		:Col = "Pass"
	,
		:Col = test_cols[idx];
	);
);
-Jarmo

Recommended Articles