Monday, March 19, 2007

Nest SUBR functions

SUBR("-IFS",SUBR("-EQS",COLOR,REUSE("Black")),"Black","Not Black")

You must nest functions in a virtual attribute to achieve the results you desire.
You must delimit the separate formulas of nested functions with parentheses. When UniData encounters a virtual attribute formula containing nested functions, UniData evaluates from the innermost formula to the outermost.
When performing comparisons of a single value to a multivalued or multi-subvalued attribute, you need to use the REUSE function so that the comparison can be made for all the values in the multivalued attribute. If you do not use the REUSE function, the comparison is made only against the first value.This virtual attribute uses the IFS subroutine to determine if COLOR is equal to Black. Since COLOR is a multi-subvalued attribute, you must use this subroutine rather than the IF/THEN/ELSE statement used with singlevalued attributes.
The EQS subroutine is nested within the IFS subroutine, telling UniData to evaluate the COLOR attribute to test for Black. Since you want to evaluate each value, you need to use the REUSE function to tell UniData to test for Black against each value.
The final two arguments of the IFS subroutine are Black and Not Black. If the result of the EQS subroutine is true, then Black becomes the value of the virtual attribute, otherwise the value is Not Black.

No comments:

如何发掘出更多退休的钱?

如何发掘出更多退休的钱? http://bbs.wenxuecity.com/bbs/tzlc/1328415.html 按照常规的说法,退休的收入必须得有退休前的80%,或者是4% withdrawal rule,而且每年还得要加2-3%对付通胀,这是一个很大...