Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Formula bringing back duplicates

Posted on 2007-08-11
4
Medium Priority
?
184 Views
Last Modified: 2010-04-16
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
  )
  )
0
Comment
Question by:RDesigns
  • 2
3 Comments
 
LVL 27

Accepted Solution

by:
Dabas earned 2000 total points
ID: 19681872
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
 
LVL 27

Expert Comment

by:Dabas
ID: 19681874
Probably replacing 'and' with 'or' will solve your problem, but I do not know what exactly you wnat to do!
0
 
LVL 1

Expert Comment

by:Computer101
ID: 20209491
Forced accept.

Computer101
EE Admin
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
Simple Linear Regression
Screencast - Getting to Know the Pipeline

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question