Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parenthesis Help

Status
Not open for further replies.

hbarbs

Instructor
Mar 20, 2006
19
US
Hi. I am working in Crystal 8.5 and The Raiser's Edge. I am trying to put parenthesis around a Variance if it is less than Annual Commitment. My formula looks like below as of now, but I am stuck with what to put after "then" to have it put the ()in.

if isnull({@Contributions this Period}) then {@Annual Commitment} else Sum ({@Annual Commitment}, {GfCnAttrCat_1.GfCnAttrCat_1_Description}) - Sum ({@Contributions this Period}, {GfCnAttrCat_1.GfCnAttrCat_1_Description});
if {@Variance} > {@Annual Commitment} then ?

Thanks for any help in advance.
 
if isnull({@Contributions this Period}) then {@Annual Commitment} else Sum ({@Annual Commitment}, {GfCnAttrCat_1.GfCnAttrCat_1_Description}) - Sum ({@Contributions this Period}, {GfCnAttrCat_1.GfCnAttrCat_1_Description});
if {@Variance} > {@Annual Commitment} then
"(" & totext(@variance,2,",") & ")"
else
totext(@variance,2,",")

The 2 says the number of decimal palces, the "," states the thousands delimiter.

Check help on totext for other options.

-k
 
Thanks so much for responding. I am getting an error of "The ) is missing" and used the exact formula. Any thoughts on where it's missing from?

Thanks a bunch...I will also check out more info on totext as well.
 
Please post what you tried, it doesn't take that much effort...

It looks OK to me.

-k
 
Sorry about that...below is an exact copy of the formula I tried.

if isnull({@Contributions this Period}) then {@Annual Commitment} else Sum ({@Annual Commitment}, {GfCnAttrCat_1.GfCnAttrCat_1_Description}) - Sum ({@Contributions this Period}, {GfCnAttrCat_1.GfCnAttrCat_1_Description});
if {@Variance} > {@Annual Commitment} then
"(" & totext(@variance,2,",") & ")"
else
totext(@variance,2,",")

Thanks again for your help.
 
Curly brackets are missing from the formula name:

if isnull({@Contributions this Period}) then {@Annual Commitment} else Sum ({@Annual Commitment}, {GfCnAttrCat_1.GfCnAttrCat_1_Description}) - Sum ({@Contributions this Period}, {GfCnAttrCat_1.GfCnAttrCat_1_Description});
if {@Variance} > {@Annual Commitment} then
"(" & totext({@variance},2,",") & ")"
else
totext({@variance},2,",")

You could also just use the following for your last clause:

if {@Variance} > {@Annual Commitment} then -{@Variance} else {@Variance}

The negative amount should default to an amount in parens.

-LB

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top