on 05-12-2015 5:44 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.