cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
%3CLINGO-SUB%20id%3D%22lingo-sub-211488%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EAvoir%20une%20syntaxe%20pour%20sp%C3%A9cifier%20plusieurs%20colonnes%20cons%C3%A9cutives%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-211488%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3ECe%20script%20fonctionne.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Edt%20%26lt%3B%26lt%3B%20New%20Column(%20%22FrontPeak%22%2C%0A%20%22numeric%22%2C%0A%20%22continuous%22%2C%0A%20setFormula(%0A%20%20If(%20%3ADISPENSESPEED%20%3D%3D%201550%2C%0A%20%20%20Maximum(%0A%20%20%20%20%3AR029%2C%0A%20%20%20%20%3AR030%2C%0A%20%20%20%20%3AR031%2C%0A%20%20%20%20%3AR032%2C%0A%20%20%20%20%3AR033%2C%0A%20%20%20%20%3AR034%2C%0A%20%20%20%20%3AR035%2C%0A%20%20%20%20%3AR036%2C%0A%20%20%20%20%3AR037%2C%0A%20%20%20%20%3AR038%0A%20%20%20)%20*%201000%2C%0A%20%20%20.%0A%20%20)%0A%20)%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECependant%2C%20ce%20serait%20bien%20de%20pouvoir%20sp%C3%A9cifier%20des%20colonnes%3A%20R029%20%C3%A0%3A%20R038%20ou%20quel%20que%20soit%20le%20nombre%20de%20colonnes.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EComme%20l'excellent%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3DAVERAGE(A1%3AG1)%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-211488%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CLINGO-LABEL%3EScripting%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-211505%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20avoir%20une%20syntaxe%20pour%20sp%C3%A9cifier%20plusieurs%20colonnes%20cons%C3%A9cutives%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-211505%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3Esalut%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F13651%22%20target%3D%22_blank%22%3E%20%40UberBock%20%3C%2FA%3E%20%2C%3C%2FP%3E%0A%3CP%3ECe%20n'est%20pas%20pour%20diminuer%20la%20valeur%20de%20votre%20requ%C3%AAte%2C%20cependant%2C%20lors%20de%20la%20cr%C3%A9ation%20de%20scripts%2C%20il%20existe%20une%20solution%20assez%20simple%20depuis%20JMP%2013.%20Cela%20peut%20%C3%A9galement%20%C3%AAtre%20sp%C3%A9cifi%C3%A9%20%C3%A0%20l'aide%20de%20l'%C3%A9diteur%20de%20formule%2C%20mais%20c'est%20un%20peu%20plus%20fastidieux.%20Voir%20le%20script%2C%20la%20formule%20et%20le%20r%C3%A9sultat%20ci-dessous.%20Je%20ne%20stocke%20pas%20les%20formules%20dans%20la%20table%20de%20donn%C3%A9es%20sauf%20si%20elles%20sont%20n%C3%A9cessaires.%26nbsp%3B%20L'%C3%A9diteur%20de%20formule%20met%20en%20garde%20contre%20l'utilisation%20de%20la%20table%20de%20donn%C3%A9es%20actuelle%20()%20dans%20une%20formule%2C%20la%20formule%20a%20donc%20besoin%20du%20nom%20de%20la%20table.%20En%20utilisant%20mon%20pr%C3%A9f%C3%A9r%C3%A9%20Set%20Each%20Value%20()%20au%20lieu%20d'une%20formule%2C%20la%20r%C3%A9f%C3%A9rence%20de%20table%20(dt%20ou%20nom%20dans%20votre%20script)%20peut%20%C3%AAtre%20utilis%C3%A9e%20%C3%A0%20la%20place%20du%20nom%20de%20la%20table%20de%20donn%C3%A9es.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20to%20Here(1)%3B%0A%0Adt%20%3D%20Open(%22%24Sample_Data%2FSemiconductor%20Capability.jmp%22)%3B%0A%0Atestcol%20%3D%20dt%20%26lt%3B%26lt%3B%20New%20Column(%22Maximum%207-11%22%2C%20numeric%2C%20continuous%2C%0A%20Formula(If(%3ASITE%3D%3D5%2C%20Maximum(Data%20Table(%22Semiconductor%20Capability%22)%5Brow()%2C4%3A%3A7%5D)%20))%0A)%3B%0A%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20860px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20860px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20860px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F17506i5F2D3B060477E385%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20938px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20938px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20938px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F17507iA984AA385F2B14B8%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-560874%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Avoir%20une%20syntaxe%20pour%20sp%C3%A9cifier%20plusieurs%20colonnes%20cons%C3%A9cutives%20-%20Statut%20chang%C3%A9%20en%20%3A%20Archiv%C3%A9%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-560874%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ENous%20archivons%20cette%20demande.%20Si%20cela%20est%20toujours%20important%2C%20veuillez%20commenter%20avec%20des%20d%C3%A9tails%20suppl%C3%A9mentaires%20et%20nous%20rouvrirons.%20Merci%20!%3C%2FLINGO-BODY%3E
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!