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.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.
  • JMP will suspend normal business operations for our Rest and Recharge Day on Friday, October 2, 2026.
    Regular business hours will resume on Monday, October 5, 2026.

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