I have the statement:
If( ((col != Column( "ASSAY_PURITY" )) | col != Column( "Total Sum" )),
If( (col[theRow] > target & !Is Missing( col[theRow] )),
result = "Fail"
)
);
col is a variable tracking the column name. I am checking to see if the column name is not equal to either Assay Purity or Total Sum. If true then it will check against a limit and it is greater than the limit than the variable result will fail.
Can you let me know if I can or cannot put the | or in the if statement.
The | operator is a logical OR.
So, in English your condition as you've written it is "if col is not ASSAY_PURITY OR col is not TOTAL SUM then..." Since col can't be both of those values at the same time that condition will always be true. You want an AND between them which is the & operator.
If( ((col != Column( "ASSAY_PURITY" )) & col != Column( "Total Sum" )),
If( (col[theRow] > target & !Is Missing( col[theRow] )),
result = "Fail"
)
);
The | operator is a logical OR.
So, in English your condition as you've written it is "if col is not ASSAY_PURITY OR col is not TOTAL SUM then..." Since col can't be both of those values at the same time that condition will always be true. You want an AND between them which is the & operator.
If( ((col != Column( "ASSAY_PURITY" )) & col != Column( "Total Sum" )),
If( (col[theRow] > target & !Is Missing( col[theRow] )),
result = "Fail"
)
);