Registered User Joined: 4/14/2007 Posts: 37
|
Hello,
i wrote this formula
"100*(c-c1)/c1>10 and c>1 and c<50 or 100*(c1-c2)/c2>10 and c>1 and c<50"
to check stocks which increased more than 10% this week an the last, but it shows only
stocks from the current week. The part of the formula after "Or" doesn`t work.
What did i wrong?
Thanks
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I suspect it is just an issue with your expected order of operation compared to the actual order of operations. OR has a higher priority than AND. This means OR gets evaluated prior to AND unless you force the order of operations with parentheses.
(100 * (C - C1) / C1 > 10 AND C > 1 AND C < 50) OR (100 * (C1 - C2) / C2 > 10 AND C > 1 AND C < 50)
You could shorten this somewhat to the following without having to use OR at all.
1 < C AND C < 50 AND CountTrue(10 * C > 11 * C1, 2) > 0
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 4/14/2007 Posts: 37
|
Thanks Bruce
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|