Expression Not Evaluating.Always mystified by how to use Eval Expr correctly. I have this pop up that asks for a wildcard column name selection and assigns it as "Divider"
nw = New Window( "Does the Data Contain Experimental Cells?",
<<MODAL></MODAL>
I then try to evaluate the object in a column formula and whatever combination of Eval(Eval Expr( I use, nothing seems to work.
If( N Items( yVars ) == 0,
Data Table( "HIRP" ) << New Column( "Average Active Power",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula(
If(
:Heater == "Reader", Col Mean( :HL_R_HEAT, :Heater ),
Contains( :Heater, "Writer" ),
Col Mean( :HL_W_HEAT, :Heater )
)
)
),
Eval(Eval Expr(Data Table( "HIRP" ) << New Column( "Average Active Power",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula(
If(
:Heater == "Reader", Col Mean( :HL_R_HEAT, :Heater, As Column(Expr(Divider)) ),
Contains( :Heater, "Writer" ),
Col Mean( :HL_W_HEAT, :Heater, :HD_NUM, As Column(Expr(Divider)) )
)
)
)
)));
Automation and ScriptingRe: Expression Not Evaluating.Change
As Column(Expr(Divider))
To
Expr(NameExpr(As Column(dt, Divider)))
Name Expr() isn't necessary but you will end up with "nicer looking" formulas when you use that.
Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
div = "weight";
Eval(EvalExpr(
dt << New Column("C", Numeric, Continuous, Formula(
:Height / Expr(NameExpr(AsColumn(dt, div)))
))
));
Also, you can test your expression evaluations by just running the EvalExpr part instead of the whole Eval(EvalExpr(...
Re: Expression Not Evaluating.Needed a small tweak but worked, Thanks
If( N Items( yVars ) == 0,
Data Table( "HIRP" ) << New Column( "Average Active Power",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula(
If(
:Heater == "Reader", Col Mean( :HL_R_HEAT, :Heater ),
Contains( :Heater, "Writer" ),
Col Mean( :HL_W_HEAT, :Heater )
)
)
),
Eval(Eval Expr(Data Table( "HIRP" ) << New Column( "Average Active Power",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula(
If(
:Heater == "Reader", Col Mean( :HL_R_HEAT, :Heater, Expr(NameExpr(As Column( Divider))) ),
Contains( :Heater, "Writer" ),
Col Mean( :HL_W_HEAT, :Heater, :HD_NUM, Expr(NameExpr(As Column( Divider))) )
)
)
)
)));
Re: Expression Not Evaluating.Jarmo
I have something that works now but I don't understand why it works. Is there somewhere that gives a clear description of how the evaluation methodology should be employed? Hoping to spend less time on here searching for answers.
Re: Expression Not Evaluating.Session 9: Advanced JSL
Scripting Guide > Programming Methods > Advanced Expressions, Macros, and Lists
Morgan, J. (2010). “Expression Handling Functions: Part I.” JMPer Cable 26:15–19.