Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: IF THEN ELSE FORMULA TO RETURN NULL? Post Reply Post New Topic
Author Message
grecianite
Newbie
Newbie


Joined: 28 Sep 2010
Online Status: Offline
Posts: 6
Quote grecianite Replybullet Topic: IF THEN ELSE FORMULA TO RETURN NULL?
    Posted: 04 Oct 2010 at 5:35am
Hi,
 
I am trying to create a formula that will return a null value if the relevant criteria are not met.  I have previously been returning a zero, but this is no good if I want to find my lowest return, as the lowest number will always be zero....
 
Current formula is
 
if {A_PRICES.PRICE_TYPE}="Ask" then {A_PRICES.PRICE} else 0
 
but I want to write
 
if {A_PRICES.PRICE_TYPE}="Ask" then {A_PRICES.PRICE} else null
 
but get a incorrect string message :(
 
Any help greatly appreciated!!
 
Thanks
 
John
IP IP Logged
grecianite
Newbie
Newbie


Joined: 28 Sep 2010
Online Status: Offline
Posts: 6
Quote grecianite Replybullet Posted: 04 Oct 2010 at 5:49am
If it helps, I basically have a big list of pricesp and lots of price types for every day. 
 
For each date I am showing each price type and to do this I am using an IF THEN ELSE looking for the right argument (text return) and returning the relevant price and if the price does not exist to return a zero.
 
Just want to return something other than zero so I can see my lowest price ever and am just going round in circles at the moment!!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Oct 2010 at 6:52am
you cannot insert NULLS using a formula.
Consider using a Running Total with a evalaute formula that uses your conditions.
IP IP Logged
grecianite
Newbie
Newbie


Joined: 28 Sep 2010
Online Status: Offline
Posts: 6
Quote grecianite Replybullet Posted: 05 Oct 2010 at 2:37am
Thanks very much, the Running Total (excluding '0' ) worked fantastically.
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.