cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
%3CLINGO-SUB%20id%3D%22lingo-sub-480402%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EJMP%20Script%20que%20cambia%20las%20propiedades%20de%20la%20columna%20USL%20y%20LSL%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-480402%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3ETengo%20una%20funci%C3%B3n%20de%20script%20JMP%20que%20obtiene%20un%20conjunto%20de%20l%C3%ADmites%20de%20especificaci%C3%B3n%20de%20un%20archivo%20de%20texto%20que%20se%20almacena%20dentro%20de%20la%20variable%20%22Ntwk%20Osnr%20Spec%20Table%20Filename%22.%20Estoy%20tratando%20de%20cambiar%20las%20propiedades%20de%20las%20columnas%20USL%20y%20LSL%20de%20la%20columna%20%22PctDiff_ModBer_q_calcBer%20dentro%20de%20la%20tabla%20de%20datos%20%22Ntwk%20Osnr%20Data%20Table%22.%20Pero%20cuando%20ejecuto%20los%20siguientes%20comandos%20de%20secuencias%20de%20comandos%20JMP%2C%20no%20obtengo%20un%20error%20de%20secuencias%20de%20comandos%2C%20pero%20las%20propiedades%20de%20las%20columnas%20USL%20y%20LSL%20no%20se%20actualizan.%20El%20l%C3%ADmite%20de%20especificaci%C3%B3n%20que%20se%20obtiene%20del%20l%C3%ADmite%20de%20especificaci%C3%B3n%20es%201%2C7.%20Cuando%20paso%20por%20las%20siguientes%20l%C3%ADneas%2C%20el%20valor%20de%201.7%20se%20actualiza%20dentro%20de%20la%20variable%20Speclimit%2C%20pero%20las%20propiedades%20de%20las%20columnas%20USL%20y%20LSL%20no%20se%20actualizan.%20Si%20establezco%20la%20variable%20Speclimit%20en%20una%20constante%20de%201%2C7%2C%20las%20propiedades%20de%20columna%20de%20USL%20y%20LSL%20se%20establecen%20en%201%2C7%20y%20-1%2C7%20respectivamente.%20Entonces%2C%20el%20problema%20debe%20ser%20obtener%20el%20valor%20del%20archivo%20de%20texto%2C%20pero%20puedo%20resolver%20el%20problema.%20%C2%BFPuede%20alguien%20decirme%20cu%C3%A1l%20es%20la%20soluci%C3%B3n%20para%20obtener%20el%20l%C3%ADmite%20de%20especificaci%C3%B3n%20de%20un%20archivo%20de%20texto%20y%20hacer%20que%20actualice%20las%20propiedades%20de%20la%20columna%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EInclude(%20%22%24CommonScriptPath%2FFunction%20-%20Obtain%20Spec%20Limit%20Value.jsl%22%20)%3B%0ASpeclimit%20%3D%20ObtainSpecLimit(%0A%20Ntwk%20Osnr%20Spec%20Table%20Filename%2C%20DeviceType%2C%20%22*%22%2C%20%22*%22%2C%20%22ber_diffQcalc%22%0A)%3B%0A%0Adt%20%3D%20Open(%20Ntwk%20Osnr%20Data%20Table%20Filename%2C%20invisible%20)%3B%0AData%20Table(%20dt%20)%3APctDiff_ModBer_q_calcBer%20%26lt%3B%26lt%3B%20Set%20Property(%0A%20%22Spec%20Limits%22%2C%0A%20%7BLSL(%20(Speclimit%20*%20(-1))%20)%2C%20USL(%20Speclimit%20)%2C%20Target(%200%20)%2C%20Show%20Limits(%201%20)%7D%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-480402%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CLINGO-LABEL%3Esecuencias%20de%20comandos%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-480421%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20Script%20JMP%20que%20cambia%20las%20propiedades%20de%20la%20columna%20USL%20y%20LSL%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-480421%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EAseg%C3%BArese%20de%20que%20los%20valores%20sean%20num%C3%A9ricos%20e%20intente%20usar%20Eval(EvalExpr())%20y%20Expr()%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EInclude(%22%24CommonScriptPath%2FFunction%20-%20Obtain%20Spec%20Limit%20Value.jsl%22)%3B%0ASpeclimit%20%3D%20ObtainSpecLimit(Ntwk%20Osnr%20Spec%20Table%20Filename%2C%20DeviceType%2C%20%22*%22%2C%20%22*%22%2C%20%22ber_diffQcalc%22)%3B%0A%0Adt%20%3D%20Open(Ntwk%20Osnr%20Data%20Table%20Filename%2C%20invisible)%3B%0AEval(%0A%20Eval%20Expr(%0A%20%20Data%20Table(dt)%3APctDiff_ModBer_q_calcBer%20%26lt%3B%26lt%3B%20Set%20Property(%0A%20%20%20%22Spec%20Limits%22%2C%0A%20%20%20%7BLSL(Expr(Speclimit%20*%20(-1)))%2C%20USL(Expr(Speclimit))%2C%20Target(0)%2C%20Show%20Limits(1)%7D%0A%20%20)%0A%20)%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FJSL-Cookbook%2FInsert-one-expression-into-another-using-Eval-Insert-Eval-Expr%2Fm-p%2F48998%23U48998%22%20class%3D%22lia-mention-container-editor-message%20lia-img-icon-tkb-thread%20lia-fa-icon%20lia-fa-tkb%20lia-fa-thread%20lia-fa%22%20target%3D%22_blank%22%3EInserte%20una%20expresi%C3%B3n%20en%20otra%20usando%20Eval%20Insert%2C%20Eval%20Expr%2C%20Parse%20y%20Substitute%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-480422%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20Script%20JMP%20que%20cambia%20las%20propiedades%20de%20la%20columna%20USL%20y%20LSL%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-480422%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3ELos%20c%C3%A1lculos%20que%20est%C3%A1%20especificando%20dentro%20de%20una%20lista%20JMP%20no%20se%20evaluar%C3%A1n%20antes%20de%20la%20ejecuci%C3%B3n.Por%20lo%20tanto%2C%20la%20declaraci%C3%B3n%20debe%20analizarse%20y%20evaluarse%20por%20completo%20antes%20de%20que%20la%20funci%C3%B3n%20de%20sustituci%C3%B3n%20logre%20eso.%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EInclude(%20%22%24CommonScriptPath%2FFunction%20-%20Obtain%20Spec%20Limit%20Value.jsl%22%20)%3B%0ASpeclimit%20%3D%20ObtainSpecLimit(%0A%20Ntwk%20Osnr%20Spec%20Table%20Filename%2C%20DeviceType%2C%20%22*%22%2C%20%22*%22%2C%20%22ber_diffQcalc%22%0A)%3B%0A%0Adt%20%3D%20Open(%20Ntwk%20Osnr%20Data%20Table%20Filename%2C%20invisible%20)%3B%0A%0AEval(%0A%20Substitute(%0A%20%20%20Expr(%0A%20%20%20%20Data%20Table(%20dt%20)%3APctDiff_ModBer_q_calcBer%20%26lt%3B%26lt%3B%0A%20%20%20%20Set%20Property(%0A%20%20%20%20%20%22Spec%20Limits%22%2C%0A%20%20%20%20%20%7BLSL(%20__LSL__%20)%2C%20USL(%20__USL__%20)%2C%20Target(%200%20)%2C%20Show%20Limits(%201%20)%7D%0A%20%20%20%20)%0A%20%20%20)%2C%0A%20%20Expr(%20__LSL__%20)%2C%20Speclimit%20*%20(-1)%2C%0A%20%20Expr(%20__USL__%20)%2C%20Speclimit%0A%20)%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
kprentiss
Level I

JMP Script that changes the column USL and LSL properties

I have a JMP Script Function that obtains a set of spec limits from a text file that is stored within the "Ntwk Osnr Spec Table Filename" variable. I am trying to change the USL and LSL column properties of the "PctDiff_ModBer_q_calcBer column within the "Ntwk Osnr Data Table" data table. But when I run the following JMP script commands I do not get a scripting error but the USL and LSL column properties are not updated. The Spec Limit that is obtained from the spec limit is 1.7. When I step thru the following lines the value of 1.7 is updated within the Speclimit variable but the USL  and LSL Column Properties are not updated. If I set the Speclimit variable to a constant 1.7 then the USL and LSL Column Properties are set to 1.7 and -1.7 respectively. So the issue must be obtaining the value from the text file, but I can figure out the issue. Can some one let me know what the solution is to obtain the spec limit from a text file and have it update the column properties.

 

Include( "$CommonScriptPath/Function - Obtain Spec Limit Value.jsl" );
Speclimit = ObtainSpecLimit(
	Ntwk Osnr Spec Table Filename, DeviceType, "*", "*", "ber_diffQcalc"
);

dt = Open( Ntwk Osnr Data Table Filename, invisible );
Data Table( dt ):PctDiff_ModBer_q_calcBer << Set Property(
	"Spec Limits",
	{LSL( (Speclimit * (-1)) ), USL( Speclimit ), Target( 0 ), Show Limits( 1 )}
);
2 REPLIES 2
jthi
Super User

Re: JMP Script that changes the column USL and LSL properties

Make sure the values are numeric and try using Eval(EvalExpr()) and Expr()

Include("$CommonScriptPath/Function - Obtain Spec Limit Value.jsl");
Speclimit = ObtainSpecLimit(Ntwk Osnr Spec Table Filename, DeviceType, "*", "*", "ber_diffQcalc");

dt = Open(Ntwk Osnr Data Table Filename, invisible);
Eval(
	Eval Expr(
		Data Table(dt):PctDiff_ModBer_q_calcBer << Set Property(
			"Spec Limits",
			{LSL(Expr(Speclimit * (-1))), USL(Expr(Speclimit)), Target(0), Show Limits(1)}
		)
	)
);

Insert one expression into another using Eval Insert, Eval Expr, Parse, and Substitute 

-Jarmo
txnelson
Super User

Re: JMP Script that changes the column USL and LSL properties

The calculations you are specifying within a JMP List, will not be evaluated prior to execution.  Therefore, the statement must be fully parsed and evaluated before  The Substitution function will accomplish that

Include( "$CommonScriptPath/Function - Obtain Spec Limit Value.jsl" );
Speclimit = ObtainSpecLimit(
	Ntwk Osnr Spec Table Filename, DeviceType, "*", "*", "ber_diffQcalc"
);

dt = Open( Ntwk Osnr Data Table Filename, invisible );

Eval(
	Substitute(
			Expr(
				Data Table( dt ):PctDiff_ModBer_q_calcBer <<
				Set Property(
					"Spec Limits",
					{LSL( __LSL__ ), USL( __USL__ ), Target( 0 ), Show Limits( 1 )}
				)
			),
		Expr( __LSL__ ), Speclimit * (-1),
		Expr( __USL__ ), Speclimit
	)
);

 

Jim