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
Medium Priority
184 Views
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'

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
Question by:RDesigns
• 2

LVL 27

Accepted Solution

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

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

ID: 20209491
Forced accept.

Computer101
0

## Featured Post

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
###### Suggested Courses
Course of the Month15 days, 15 hours left to enroll