cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Instantly extract effect sizes, F-ratios, and FDR-adjusted p-values from your models with the Calculate Effects Sizes extension, available now in the JMP Marketplace!
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • See how to use the JMP Marketplace – Free tools to expand JMP capabilities. Register. July 10, 2 pm US Eastern Time.

Discussions

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

conditional match with two columns

Hi JMP users

How to write a script to print a value from column:EtOH % form maximum index of : fermentation Age .

For example: if the maximum fermentation Age for Batch 03-05-2022 is 68 then the EtOH % value (13.45) should be picked and printed to the output column.

chandankishor66_0-1685763069997.png

Attached a JMP table here.

Looking forward for your suggestion

Regards

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: conditional match with two columns

Here are 2 similar approaches to solve your issue.

Names Default To Here( 1 );
dt = Current Data Table();
dt << New Column( "Output 2",
	formula(
		theMax = Col Maximum( :EtOH %, :Batch );
		If( theMax == :EtOH %,
			:EtOH %,
			.
		);
	)
);
Names Default To Here( 1 );
dt = Current Data Table();
dt << New Column( "Output 3" );
for each row(
	theMax = Col Maximum( :EtOH %, :Batch );
		If( theMax == :EtOH %,
			:Output3 = :EtOH %,
			:Output3 = .
		);
);
Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: conditional match with two columns

Here are 2 similar approaches to solve your issue.

Names Default To Here( 1 );
dt = Current Data Table();
dt << New Column( "Output 2",
	formula(
		theMax = Col Maximum( :EtOH %, :Batch );
		If( theMax == :EtOH %,
			:EtOH %,
			.
		);
	)
);
Names Default To Here( 1 );
dt = Current Data Table();
dt << New Column( "Output 3" );
for each row(
	theMax = Col Maximum( :EtOH %, :Batch );
		If( theMax == :EtOH %,
			:Output3 = :EtOH %,
			:Output3 = .
		);
);
Jim
chandankishor66
Level III

Re: conditional match with two columns

Thank you, Jim.

Recommended Articles