Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 2/7/2006 Posts: 27
|
Hello, can you explain the SGN function in TC2007? The help file's explanation is very brief. I think that it's supposed to return +1 for true values and -1 for false values. The help file says that it's also supposed to return 0, but when would that happen?
On symbol TAT, testing SGN(V30 = V30) results in a value of -1. Shouldn't this be +1?
On symbol TAT, testing SGN(V30 > V) results in a value of 0 when the statement is false. Shouldn't this be -1?
On symbol TAT, testing SGN(AVG(V10,10)<AVG(V10,10)) results in a value of 0. Shouldn't this be -1?
Thank you.
|
|
Registered User Joined: 2/7/2006 Posts: 27
|
Please disregard, I figured this out. Thanks.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I'm happy to read you were able to figure it out on your own.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Platinum Customer
Joined: 6/9/2009 Posts: 5
|
I have the same issue. SGN(c > c1 and c1 > c2) gives me -1 when true and I have not figured out to correct it. Any advice?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
SGN() returns -1 when what is being evaluated is negative, 1 when what is being evaluated is positive and 0 when what is being evaluated is zero.
Since (C > C1 and C1 > C2) will return -1 when True and 0 when False, SGN(C > C1 AND C1 > C2) will return the same thing. If you want to force it return 1 when True and 0 when False, use:
ABS(C > C1 AND C1 > C2)
PCF Formula Descriptions
How to create a Personal Criteria Forumula (PCF)
Handy PCF example formulas to help you learn the syntax of PCFs!
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |