Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

SGN function Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
Constellation
Posted : Wednesday, February 23, 2011 7:13:52 PM
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.
Constellation
Posted : Thursday, February 24, 2011 1:52:50 AM
Registered User
Joined: 2/7/2006
Posts: 27
Please disregard, I figured this out. Thanks.
Bruce_L
Posted : Thursday, February 24, 2011 9:32:34 AM


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
lweiss23
Posted : Monday, February 28, 2011 12:13:01 PM
Platinum Customer 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?
Bruce_L
Posted : Monday, February 28, 2011 1:04:51 PM


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
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.