cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

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

Referencing Columns from other tables in a formula (Calculating Yield)

Hello, 

 

I would like to calculate row data by referencing columns/data found in another table.  I am trying to calculate Yield in Table #2 by pulling data from Table #1 without joining the tables. Is there a way to do this? Here is what I have so far...

 

Table #1 = WaferRgDt

Table #2 = dt1 : I am trying to populate this with data that is calculated from Table #1

saneal_1-1623167047159.png

 

For( j = 1, j <= N Rows( dtWaferIDList ), j++,
	Eval(
		Parse(
			tempj = Column( dtWaferIDList, 1 )[j];
			dt1 << select where( :Wafer == tempj);
			dt1 << Add Rows({Wafer = tempj
			, NTested = If( Selected( Row State( Row() ) ), Col Number( :Name("FailDie")))
			, GoodDie = If( Selected( Row State( Row() ) ), Col Number( If(:Name("FailDie") == 0, 1, . )))
			, Yield = If( Selected( Row State( Row() ) ), 100 * :Name("GoodDie") / :Name("NTested"))})
		)
	)
	
);

The main logical issue with this code I am having is that the column "FailDie" is not a part of table dt1, but instead a part of Table #2 and I don't think it is able to read that data in its current state.

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Referencing Columns from other tables in a formula (Calculating Yield)

Here is an example of one way to handle what you are looking to do:

g1.JPG

Names Default To Here( 1 );
dt = Open( "$sample_data/big class.jmp" );
dt1 = new table("Final",
	new Column("Gender", character),
	new column("Mean"),
	new column("Count")
);

Summarize( dt, dtWaferIDList = By( :sex ) );
// Loop across groups found in Summarize // Changed to using k as an index. There is a j() function in JMP // and using k will avoid any confusion For( k = 1, k <= N Items( dtWaferIDList ), k++, dt1 << add rows( 1 ); dt1:Gender[k] = dtWaferIDList[k]; // Find rows in dt data table that match the current Gender theRows = dt << get rows where( dt:sex == dtWaferIDList[k] ); // Calculate Mean dt1:Mean[k] = Mean( dt:Height[theRows] ); // Calculate the Count dt1:Count[k] = N Rows( theRows ); );
Jim

View solution in original post

1 REPLY 1
txnelson
Super User

Re: Referencing Columns from other tables in a formula (Calculating Yield)

Here is an example of one way to handle what you are looking to do:

g1.JPG

Names Default To Here( 1 );
dt = Open( "$sample_data/big class.jmp" );
dt1 = new table("Final",
	new Column("Gender", character),
	new column("Mean"),
	new column("Count")
);

Summarize( dt, dtWaferIDList = By( :sex ) );
// Loop across groups found in Summarize // Changed to using k as an index. There is a j() function in JMP // and using k will avoid any confusion For( k = 1, k <= N Items( dtWaferIDList ), k++, dt1 << add rows( 1 ); dt1:Gender[k] = dtWaferIDList[k]; // Find rows in dt data table that match the current Gender theRows = dt << get rows where( dt:sex == dtWaferIDList[k] ); // Calculate Mean dt1:Mean[k] = Mean( dt:Height[theRows] ); // Calculate the Count dt1:Count[k] = N Rows( theRows ); );
Jim

Recommended Articles