cancel
Showing results for 
Search instead for 
Did you mean: 

Adding Numbers from Formula Results

former_member406941
Participant
0 Kudos

I have two formulas that produce numbers.  I'm trying to add these together in another formula. 

Here are the 2 formulas:

{@Charge.Formula.1}

If {Billing_Data22.CPT1} in ['74178'] Then

475

else if {Billing_Data22.CPT1} in ['72148','73721'] Then

520

else if {Billing_Data22.CPT1} in ['70553','72156'] Then

650

else if isnull ({Billing_Data22.CPT1}) Then

0

{@Charge.Formula.2}

If {Billing_Data22.CPT2} in ['74178'] Then

475

else if {Billing_Data22.CPT2} in ['72148','73721'] Then

520

else if {Billing_Data22.CPT2} in ['70553','72156'] Then

650

else if isnull ({Billing_Data22.CPT2}) Then

0

Right now I'm only getting results for the rows that have values for both fields {Billing_Data22.CPT1} and {Billing_Data22.CPT2}.  If one of the fields is blank, then the return I'm getting is 0, as opposed to just the number from the non-blank field. 

The formula I have that is supposed to be adding these two formulas is this:

{@Charge.Total}

{@ABSO.Charge.Formula} + {@ABSO.Charge.Formula.2}

Thanks!

Rich

Accepted Solutions (1)

Accepted Solutions (1)

former_member292966
Active Contributor
0 Kudos

Hi Rich,

It sounds like the formula is hitting a null before other values.  Move the ISNULL portion to the top of the formulas to check for nulls first.  You can also go into File | Report Options and turn on the option for Convert Null Values to Default. 

Good luck,

Brian

former_member406941
Participant
0 Kudos

Thanks for the help!!

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Try this:

{@Charge.Formula.1}


if {Billing_Data22.CPT1} <> '' or isnull ({Billing_Data22.CPT2})

(

If {Billing_Data22.CPT1} in ['74178'] Then

475

else if {Billing_Data22.CPT1} in ['72148','73721'] Then

520

else if {Billing_Data22.CPT1} in ['70553','72156'] Then

650

)


Thanks,

DJ