cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

JMP Wish List

We want to hear your ideas for improving JMP. Share them here.
Choose Language Hide Translation Bar
0 Kudos

Have syntax for specifying multiple consecutive columns

This script works.

 

 

dt << New Column( "FrontPeak",
	"numeric",
	"continuous",
	setFormula(
		If( :DISPENSESPEED == 1550,
			Maximum(
				:R029,
				:R030,
				:R031,
				:R032,
				:R033,
				:R034,
				:R035,
				:R036,
				:R037,
				:R038
			) * 1000,
			.
		)
	)
);

 

However it would be nice to be able to be able to specify columns :R029 to :R038 or what ever number of columns.

 

Like the excel

 

=AVERAGE(A1:G1)

 

 

 

2 Comments
gzmorgan0
Super User (Alumni)

Hi @UberBock,

This is not to lessen the value of your request, however, when scripting there is a pretty easy solution since JMP 13. This can also be specified using the formula editor, but it is a little more cumbersome. See the script, the formula and the result below. I don't store formulas in data table unless they are necessary.  The formula editor warns against using Current Data Table() in a formula, so the formula needs the table name. Using my preferred Set Each Value() instead of a formula, the table reference (dt or name in you script) can be used instead of the data table name.

 

Names Default to Here(1);

dt = Open("$Sample_Data/Semiconductor Capability.jmp");

testcol = dt << New Column("Maximum 7-11", numeric, continuous,
	Formula(If(:SITE==5, Maximum(Data Table("Semiconductor Capability")[row(),4::7]) ))
);

image.png

 

image.png

Ryan_Gilmore
Community Manager
Status changed to: Archived
We are archiving this request. If this is still important please comment with additional details and we will reopen. Thank you!