Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Formula Field Post Reply Post New Topic
Author Message
Tupacmoche
Groupie
Groupie
Avatar

Joined: 04 Apr 2007
Online Status: Offline
Posts: 52
Quote Tupacmoche Replybullet Topic: Formula Field
    Posted: 12 Apr 2007 at 11:26am
I have created a number of formula fields that evaluate to true if a condition is met. There are three conditions that I'm using in yet another formula field that if evaluate to true satisfy the entire condition. My problem is that in one of the "sub formula fields" the conditions is that any and all the records for that field are valid. Some thing like:
 
 
 
IIF ({BUDGET_COMMITMENTS.ACCOUNT} = Any and all values ,1 ,0 )
 
 
 
This statement is invalid but represents what I need. Any ideas?
Rob
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 12 Apr 2007 at 12:14pm
I don't get it. If all values are valid then when will this ever be false? Are you just trying to test for NULL?
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
Tupacmoche
Groupie
Groupie
Avatar

Joined: 04 Apr 2007
Online Status: Offline
Posts: 52
Quote Tupacmoche Replybullet Posted: 12 Apr 2007 at 4:45pm

That is true if all values are valid but I have several formula fields where only a subset of the values makes them true. In two instances the whole set of values in this field make it true. So Formula A is only true for values 10, 20, 30, and 40. Formula B is only true for values 20, 40, 60, but Formula C is valid for any and every value in the field.

 

Therefore how do I write the formula field?

 

IIF ({BUDGET_COMMITMENTS.ACCOUNT} = Any and all values ,1 ,0 )

 

Rob
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 12 Apr 2007 at 7:22pm
You'll have to check my syntax, but I think you can do this:
IIF ({BUDGET_COMMITMENTS.ACCOUNT} IN (10, 20,30, 40),1 ,0 )
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
Tupacmoche
Groupie
Groupie
Avatar

Joined: 04 Apr 2007
Online Status: Offline
Posts: 52
Quote Tupacmoche Replybullet Posted: 12 Apr 2007 at 7:47pm
The syntax is :
 
IIF ({BUDGET_COMMITMENTS.ACCOUNT} in ["10", "20", "30","40"], 1, 0)
 
But Budget_commitments has about one hundred posible values who wants to type that? Therefore I need some sort of wild character that can pull in any and all values for this field.
 
Any ideas?
Rob
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 12 Apr 2007 at 8:15pm
Can't you do a regular If-Then statement? I would convert it to a string and then use string functions to test ranges of values depending upon what they are (use substring, left and right type functions)
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

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



This page was generated in 0.016 seconds.