We can define a custom formula in the custom profiler and it is quite easy, as the following example shows
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Tiretread.jmp" );
obj = Custom Profiler( Y( :Pred Formula ABRASION, :Pred Formula MODULUS ) );
obj << Objective Formula(
:Pred Formula ABRASION + .5 * :Pred Formula MODULUS
);
obj << Optimize;
Now, let's say that I would like to change the coefficient value from 0.5 to another setting. So I define the following formula:
coef=4;
myFormula=Parse(eval(EvalExpr(":Pred Formula ABRASION + "||Char(coef)||" * :Pred Formula MODULUS")));
the result in the log is ok:
:Pred Formula ABRASION + 4 * :Pred Formula MODULUS
but, if I use the same sentence in the previous statement, I do not succeed to have the expected result:
obj << Objective Formula(Parse(eval(EvalExpr(":Pred Formula ABRASION + "||Char(coef)||" * :Pred Formula MODULUS"))));

I probably did a basic mistake, but I am having trouble with it. and I would like to adapt this method to a more complex situation (change desirability coeffcients in the native expression)
Thank you for your suggestions