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%3ESyntax%20zum%20Angeben%20mehrerer%20aufeinanderfolgender%20Spalten%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-211488%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EDieses%20Skript%20funktioniert.%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%3EEs%20w%C3%A4re%20jedoch%20sch%C3%B6n%2C%20in%20der%20Lage%20zu%20sein%2C%20Spalten%20anzugeben%3A%20R029%20bis%3A%20R038%20oder%20welche%20Anzahl%20von%20Spalten%20auch%20immer.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWie%20das%20Excel%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%3ESkripting%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%3EBetreff%3A%20Syntax%20zum%20Angeben%20mehrerer%20aufeinanderfolgender%20Spalten%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-211505%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EHallo%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F13651%22%20target%3D%22_blank%22%3E%20%40%20UberBock%20%3C%2FA%3E%20%2C%3C%2FP%3E%0A%3CP%3EDies%20soll%20den%20Wert%20Ihrer%20Anfrage%20nicht%20mindern.%20Bei%20Skripten%20gibt%20es%20jedoch%20seit%20JMP%2013%20eine%20recht%20einfache%20L%C3%B6sung.%20Dies%20kann%20auch%20mit%20dem%20Formeleditor%20festgelegt%20werden%2C%20ist%20jedoch%20etwas%20umst%C3%A4ndlicher.%20Siehe%20das%20Skript%2C%20die%20Formel%20und%20das%20Ergebnis%20unten.%20Ich%20speichere%20Formeln%20nicht%20in%20der%20Datentabelle%2C%20es%20sei%20denn%2C%20sie%20sind%20notwendig.%26nbsp%3B%20Der%20Formeleditor%20warnt%20davor%2C%20die%20aktuelle%20Datentabelle%20()%20in%20einer%20Formel%20zu%20verwenden%2C%20daher%20ben%C3%B6tigt%20die%20Formel%20den%20Tabellennamen.%20Unter%20Verwendung%20meines%20bevorzugten%20Set%20Each%20Value%20()%20anstelle%20einer%20Formel%20kann%20die%20Tabellenreferenz%20(dt%20oder%20name%20in%20Ihrem%20Skript)%20anstelle%20des%20Datentabellennamens%20verwendet%20werden.%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%3EBetreff%3A%20Syntax%20zum%20Angeben%20mehrerer%20aufeinanderfolgender%20Spalten%20vorhanden%20-%20Status%20ge%C3%A4ndert%20in%3A%20Archiviert%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-560874%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EWir%20archivieren%20diese%20Anfrage.%20Wenn%20sie%20noch%20wichtig%20ist%2C%20hinterlassen%20Sie%20bitte%20einen%20Kommentar%20mit%20weiteren%20Details%20und%20wir%20%C3%B6ffnen%20sie%20erneut.%20Vielen%20Dank!%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!