Hi Folks,
When I run the below script, the target value as per variable Targ of 8 is not being passed to the CuSum chart. Instead a Target value of 8.09629 is calculated and used. What's going on, and how do a pass a target value of 8 into the script ?
Thanks
Names Default To Here( 1 );
targ = 8;
dt = Open( "$SAMPLE_DATA/Quality Control/Oil1 Cusum.jmp" );
obj = dt << CUSUM Control Chart( Y( :weight ), X( :hour ), Target (targ), Sigma (0.05), head start (0.05)
);
You can evaluate it there for example by using Eval(EvalExpr())
Names Default To Here(1);
targ = 8;
dt = Open("$SAMPLE_DATA/Quality Control/Oil1 Cusum.jmp");
Eval(EvalExpr(
obj = dt << CUSUM Control Chart(
Y(:weight),
X(:hour),
Target(Expr(targ)),
Sigma(0.05),
head start(0.05)
);
));
It gets a bit more complicated if you wish to use By variable. I would most likely loop over each of the platforms (this might be different between JMP versions). This hopefully gives some idea of what you could do
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Quality Control/Vial Fill Weights.jmp");
targs = ["1" => 5, "2" => 6, "3" => 7, "4" => 8, "5" => 9];
Eval(
Eval Expr(
ccs = dt << CUSUM Control Chart(
Y(:Fill Weight),
X(:Sample),
By(:Day)
)
)
);
For Each({cur_cc}, ccs,
cur_rep = Report(cur_cc);
cur_day = Word(-1, (cur_rep << get title), "=");
Eval(EvalExpr(
cur_cc << Target(Expr(targs[cur_day]));
));
);
Basically I have "spec" associative array, then I get the "filtered" value using Word(-1,...), retrieve value from associative array with that and use it to set the target
You can evaluate it there for example by using Eval(EvalExpr())
Names Default To Here(1);
targ = 8;
dt = Open("$SAMPLE_DATA/Quality Control/Oil1 Cusum.jmp");
Eval(EvalExpr(
obj = dt << CUSUM Control Chart(
Y(:weight),
X(:hour),
Target(Expr(targ)),
Sigma(0.05),
head start(0.05)
);
));
Perfect. Thank you.
based on solution above, how would I now implement similar for multiple CuSum charts where By: is used, but all having different target values depending on the day.. So in the following script example, If Day =1, targ = 6. if day =2, targ = 7, etc,etc
Names Default To Here(1);
targ = 8;
dt = Open("$SAMPLE_DATA/Quality Control/Oil1 Cusum.jmp");
Eval(EvalExpr(
obj = dt << CUSUM Control Chart(
Y(:weight),
X(:hour),
Target(Expr(targ)),
Sigma(0.05),
head start(0.05)
);
));
It gets a bit more complicated if you wish to use By variable. I would most likely loop over each of the platforms (this might be different between JMP versions). This hopefully gives some idea of what you could do
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Quality Control/Vial Fill Weights.jmp");
targs = ["1" => 5, "2" => 6, "3" => 7, "4" => 8, "5" => 9];
Eval(
Eval Expr(
ccs = dt << CUSUM Control Chart(
Y(:Fill Weight),
X(:Sample),
By(:Day)
)
)
);
For Each({cur_cc}, ccs,
cur_rep = Report(cur_cc);
cur_day = Word(-1, (cur_rep << get title), "=");
Eval(EvalExpr(
cur_cc << Target(Expr(targs[cur_day]));
));
);
Basically I have "spec" associative array, then I get the "filtered" value using Word(-1,...), retrieve value from associative array with that and use it to set the target
Awesome. Thank you so much.
Thank you so much for the solution