Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Formula producing duplicates Post Reply Post New Topic
Author Message
dawnh44
Groupie
Groupie


Joined: 25 Sep 2011
Online Status: Offline
Posts: 79
Quote dawnh44 Replybullet Topic: Formula producing duplicates
     Posted: 30 Apr 2012 at 6:24am
Hello everyone,
 
I have a formula that is pulling the same results twice.  Please see the following:
 
if {#RTotal0} <> DistinctCount ({cq_letter;1.a1_name}, {cq_letter;1.sr_num}) then
If isnull({cq_letter;1.a2_name}) = true or {cq_letter;1.a2_name} = "" then
    {cq_letter;1.a1_name} & ','
else
    {cq_letter;1.a1_name} & '; ' & {cq_letter;1.a2_name} & ','
else
If isnull({cq_letter;1.a2_name}) = true or {cq_letter;1.a2_name} = "" then
    {cq_letter;1.a1_name}
else
    {cq_letter;1.a1_name} & '; ' & {cq_letter;1.a2_name}
 
My results look something like the following:
 
Dr. abc  something, IL
Dr. abc  something, IL
 
Dr. def  something, TX
Dr. def  something, TX
 
Can someone help me?  This formula was created by someone else.
 
Thank you.
 
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 30 Apr 2012 at 7:15am
i would try something like this
if {#RTotal0} <> DistinctCount ({cq_letter;1.a1_name}, {cq_letter;1.sr_num}) then
(
If (isnull({cq_letter;1.a2_name}) = true or {cq_letter;1.a2_name}) = "" then
    {cq_letter;1.a1_name} & ','
else
    {cq_letter;1.a1_name} & '; ' & {cq_letter;1.a2_name} & ','
)
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum