Skip to Content

Adding Numbers from Formula Results

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on May 12, 2015 at 04:56 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 12, 2015 at 04:56 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.