cancel
Showing results for 
Search instead for 
Did you mean: 

If then else statements

Former Member
0 Kudos

I am trying to create a formula that returns results based on a string of embeded if then else statements such that if field A is greater than zero, then return that value, else if field B is greater then zero, then return that value, else return the value of field C.

How do I do this?

Here's my current formula, but it currently only returns the value of the first field or a blank.

If {qryILDataForCrystal.MISFRate} > 0 then {qryILDataForCrystal.MISFRate}

else if {qryILDataForCrystal.CurrentRate} >0 then {qryILDataForCrystal.CurrentRate}

else {qryILDataForCrystal.AnnualCombinedIRR}

please help.

thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Please select "Default Values for nulls" in the formula editor. You can find this at the top in formula editor where the default option is "Exception for nulls".

Now try this formula

If {qryILDataForCrystal.MISFRate} > 0 then {qryILDataForCrystal.MISFRate}

else if {qryILDataForCrystal.CurrentRate} >0 then {qryILDataForCrystal.CurrentRate}

else {qryILDataForCrystal.AnnualCombinedIRR}

Regards,

Raghavendra

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi..

Try the following :

if not isnull({qryILDataForCrystal.MISFRate}) and

not isnull({qryILDataForCrystal.CurrentRate}) Then

If {qryILDataForCrystal.MISFRate} > 0 then {qryILDataForCrystal.MISFRate}

else if {qryILDataForCrystal.CurrentRate} >0 then {qryILDataForCrystal.CurrentRate}

else {qryILDataForCrystal.AnnualCombinedIRR}

Thanks,

Sastry