Print Page | Close Window

Boolean required here

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=10209
Printed Date: 01 May 2024 at 6:31am


Topic: Boolean required here
Posted By: deano
Subject: Boolean required here
Date Posted: 08 Jun 2010 at 6:16am
I typed  formula  --- If {product category} = "SI" then {Qty Shipped} / 1000 else {Qty Shipped}
 
I get an error message between "else" and "{Qty Shipped} that a Boolean is required here.
 
I am using cross-tabs to show quanty shipped in each product category by each territory across the US.  Some numbers become rather large so would like to divide them them by 1000.  But others are small so want to see whole number not divided by 1000.
 
What is wrong with my formula????
 
Deano



Replies:
Posted By: DBlank
Date Posted: 08 Jun 2010 at 6:36am
Did you place this formula in the record selection?
It should be in a New Fomrual in the Field Explorer.


Posted By: deano
Date Posted: 08 Jun 2010 at 7:52am
Where I am having trouble is in Select Expert....Formula Editor.  I had made the formula in Field Explorer and had no problem ... the formula was accepted with no errors....however I don't know where to put it.  I tried placing it on one of the cross-tab squared but it didn't replace what was already there. ?????


Posted By: DBlank
Date Posted: 08 Jun 2010 at 8:23am
Where you inserted QTY SHipped into your Crosstab Design, replaec it with your formula
Qty_Shipped_Altered
If {product category} = "SI" then {Qty Shipped} / 1000 else {Qty Shipped}
 


Posted By: deano
Date Posted: 08 Jun 2010 at 8:49am
I couldn't figure out how to just replace the formula so I remade the cross-tab page again and inserted the fromula and it worked.  Thanks!!!
 
Can you tell me what that mean when I get that error message "Boolean required here"?  And what am I suppose to do to correct my formula?


Posted By: DBlank
Date Posted: 08 Jun 2010 at 9:01am

Whenever you get that message it is expecting your formula to return TRUE or FALSE (a boolean).

Unfortunately how to correct it is not cut and dry.
 
The select expert always want to use a boolean result from a formula to decide to include (TRUE) or exclude (FALSE) a row of data. So if you put a formula that returns something other than a boolean (like yours returns a number) it can't use that information to figure out if the row is 'good' or 'bad' and spits the error.
There are other places that you will get a boolean error as well but too many to explain nor do I know them all Shocked
Does that help?



Print Page | Close Window