Formula bringing back duplicates

Hi experts
Can anyone help with this formula
For some reason the {P.ARC} = 'N' is not working for one of the sets of records and it is bringing back values where the P.ARC is not 'N'

Thanks for your help
RD


if IsNull({P.AMT}) then
(
  0
)
else
(
  if ( {P.REF} in [3678,1657] and {P.ARC} = 'N' ) then
  (
     {P.AMT}
  )
  else
  (
     if {P.ARC} = 'C' then
        {P.AMT}
     else
        0
  )
  )
RDesignsAsked:
Who is Participating?
 
DabasCommented:
Hello RDesigns,

I have the feeling the problem is caused by the following line:

  if ( {P.REF} in [3678,1657] and {P.ARC} = 'N' ) then

This means that for {P.AMT} to happen you need BOTH P.Ref to be one of 3678 or 1657 AND P.Arc to be N
If P.Ref is anything else, say 1234, then the logic will move to the else statement, and because P.Arc is not 'C', the value returned is 0


Regards,

Dabas
0
 
DabasCommented:
Probably replacing 'and' with 'or' will solve your problem, but I do not know what exactly you wnat to do!
0
 
Computer101Commented:
Forced accept.

Computer101
EE Admin
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.