This content has been marked as final.
Show 7 replies

1. Re: Member formula IF ( "A1" > 0) THEN "A1" END + IF ( "A2" > 0) THEN "A2" END
_RahulS_ Jun 6, 2013 2:38 PM (in response to roboh)I believe you asking for member formula not member ;)
IF ( "A1" > 0)
"A1" ;
ENDIF;
IF ( "A2" > 0)
"A2" ;
ENDIF; 
2. Re: Member formula IF ( "A1" > 0) THEN "A1" END + IF ( "A2" > 0) THEN "A2" END
roboh Jun 6, 2013 2:42 PM (in response to _RahulS_)Yes :)
but the overall affect should be
If A1 > 0 then A1 + If A2 > 0 then A2 + ....
It means A1= 1 and A2 = 2 then 3,
A1 = 1 and A2 = 2 then 2,...
thx 
3. Re: Member formula IF ( "A1" > 0) THEN "A1" END + IF ( "A2" > 0) THEN "A2" END
Celvin Kattookaran Jun 6, 2013 2:48 PM (in response to roboh)Ok, then it'll be
RegardsIF (A1 > 0) A1 + A2 ; ELSE A2 ; ENDIF;
Celvin
http://www.orahyplabs.com 
4. Re: Member formula IF ( "A1" > 0) THEN "A1" END + IF ( "A2" > 0) THEN "A2" END
GlennS_3 Jun 6, 2013 5:26 PM (in response to Celvin Kattookaran)Funny I'm presenting this as part of my thinking outside the box presentation at KScope. As a more generalized formula without if statements you could do
"A1" * ("A1">0) + "a2" * ("A2" >0);
A1> 0 will return 0 if it is 0 or negative and a 1 if positive. Same for the A2 comparison. The only problem with this is you will get zeros back if both are negative. to be more complete you would need to do
"A1" * ("A1">0/("A1">0) + "a2" * ("A2" >0/("A2" >0);
since A1 will be either 0 or 1 you get 1/1 which = 1 or 0/0 which = #missing anything times #missing is #missing 
5. Re: Member formula IF ( "A1" > 0) THEN "A1" END + IF ( "A2" > 0) THEN "A2" END
Celvin Kattookaran Jun 6, 2013 5:33 PM (in response to GlennS_3)That is a really interesting logic. I wish we had a like button.
Regards
Celvin
http://www.orahyplabs.com 
6. Re: Member formula IF ( "A1" > 0) THEN "A1" END + IF ( "A2" > 0) THEN "A2" END
Celvin Kattookaran Jun 6, 2013 5:40 PM (in response to GlennS_3)Glenn is there a gain in performance?
Regards
Celvin
http://www.orahyplabs.com 
7. Re: Member formula IF ( "A1" > 0) THEN "A1" END + IF ( "A2" > 0) THEN "A2" END
GlennS_3 Jun 6, 2013 6:24 PM (in response to Celvin Kattookaran)There can be a performance gain. IF statements have to cycle through aditional logic but math is fast.