Dear Sir,
I am debugging an if statement like the one below. I am wondering what does it evaluate on and if it would generate "1" from the unknown state of "(Eval(Eval Expr(Sum(Expr(sumCol))))== N Items(sumCol)"
Please let me know.
Thanks,
John
Strong suggestion to check out this great post about Insert one expression into another using Eval Insert, Eval Expr, Parse, and Substitute .
Names Default To Here(1); sumCol = [1,1,1]; //check in parts Show(Eval Expr(Sum(Expr(sumCol)))); Show(Eval(Eval Expr(Sum(Expr(sumCol))))); Show(N Items(sumCol)); Show(If(Eval(Eval Expr(Sum(Expr(sumCol))))== N Items(sumCol),1,0));
Do you have any idea what you're actually trying to do?
My guess is you have a script making that and people tried to put in the variable `sumCol` into the formula. with something like
Names default to here( 1 ); dt = open("$SAMPLE_DATA\Big Class.jmp"); sumCol = dt:weight << Get Values(); dt << New Column("test", Formula(if(Eval(EvalExpr(Sum(Expr(sumCol))))==Nitems(sumCol), 1, 0))); // What I think you'd want to do is Eval(EvalExpr( dt << New Column("Test 2", Formula(Sum(Expr(sumCol)) ==Nitems(Expr(sumCol)))); // or dt << New Column("Test 3", Formula( fsumCol = Expr(sumCol);// this is just letting the formula know what it is Sum(fsumCol) == Nitems(fsumCol); )); )); // you don't need the if, 1, 0 because you're boolean will eval to 1 anyway.