Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Duplicated Rows? Post Reply Post New Topic
Author Message
Robotacha
Groupie
Groupie
Avatar

Joined: 11 Nov 2009
Location: United Kingdom
Online Status: Offline
Posts: 97
Quote Robotacha Replybullet Topic: Duplicated Rows?
     Posted: 25 Apr 2012 at 12:33am
Hello, Hope someone can help quickly :(
 
I am using 2 tables: TRANSACTIONS & VANRUNS

TRANSACTIONS obviously contains all the transaction details
VANRUNS contains: CUSTOMER, NAME, VANRUN & VANDESCRIPTION
 
 
linking: TRANSACTIONS  > Left outer > VANRUNS


each customer can have upto 3 different van runs on the account (I think this is where the problem is)


I am grouping by {TRANSACTIONS.CUSTOMER}
 
then in details showing; INVOICE# , INVOICEDATE , QUANTITY

which is great.  It returns data like;
 
CUSTOMER ABC
INV123456    04/04/2012     24 units
INV345687    07/04/2012     21 units
 
 
When I add a Select Expert Filter on the the VANRUNS.VANRUN field, this is when the duplications start.

ie;  VANRUNS.VANRUN is one of 319, 320  I get data like;
 
CUSTOMER ABC
INV123456    04/04/2012     24 units
INV123456    04/04/2012     24 units
INV345687    07/04/2012     21 units
INV345687    07/04/2012     21 units
 
 
If I remove one of the vanruns, so its VANRUNS.VANRUN =319 It does not duplicate the data. It only duplicates when I include more than 1 vanrun in the select expert.

Any ideas?
 
Thanks.
Regards,

Michael Jones
IP IP Logged
yggdrasil
Senior Member
Senior Member
Avatar

Joined: 19 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 150
Quote yggdrasil Replybullet Posted: 25 Apr 2012 at 2:42am
If you add the Vanrun into the report I think you will get
 
INV123456    04/04/2012     24 units  319
INV123456    04/04/2012     24 units  320
INV345687    07/04/2012     21 units  319
INV345687    07/04/2012     21 units  320
 
which may or may not be what you want.  You may have to add a group by vanrun under customer
IP IP Logged
Robotacha
Groupie
Groupie
Avatar

Joined: 11 Nov 2009
Location: United Kingdom
Online Status: Offline
Posts: 97
Quote Robotacha Replybullet Posted: 25 Apr 2012 at 3:20am
hello,

Yes, that is how the data is duplicating.
I understand that is the reason why it is duplicating.

just dont know how to fix it so I only have 1 row of data
 
CUSTOMER ABC
INV123456    04/04/2012     24 units   319
INV345687    07/04/2012     21 units   319
Regards,

Michael Jones
IP IP Logged
Robotacha
Groupie
Groupie
Avatar

Joined: 11 Nov 2009
Location: United Kingdom
Online Status: Offline
Posts: 97
Quote Robotacha Replybullet Posted: 25 Apr 2012 at 3:22am
basically, I m trying to get some data on FILL RATES for the vans.

when I am summing Quantity by Customer, it is obviously giving me double total quantity per customer.  (or triple where customers have 3 van runs)
Regards,

Michael Jones
IP IP Logged
jkjackson@gmail
Newbie
Newbie


Joined: 23 Apr 2012
Location: United States
Online Status: Offline
Posts: 3
Quote jkjackson@gmail Replybullet Posted: 27 Apr 2012 at 5:06am
I have had very similar issues in the past and was only able to get around it by using a sub-report, linking them on the customer field, assuming that the filed "Customer" is in both tables.
joe
IP IP Logged
rkrowland
Senior Member
Senior Member
Avatar

Joined: 20 Dec 2011
Location: England
Online Status: Offline
Posts: 259
Quote rkrowland Replybullet Posted: 27 Apr 2012 at 5:32am

I'd do this using a sql command to generate the dataset I need, however I don't have time to do this for you right now.

There is another way you could get round it though, group by customer and then by invoice, place whatever sum summaries (fillrates??) from the vanruns table you need in the group header of the invoice group.
 
sum({vanruns.fillrates},{transactions.invoiceno})
 
Now for any summaries on the transactions table you can use average, or simply drag the field into the invoice group header.
 
average({transactions.quantity},{transactions.invoiceno})
 
Basically what you're doing here is making the invoiceno group header into a mock details sections, so go ahead and surpress the actual details section, you don't need it. You may want to put a blank textbox over the top of the invoiceno group header too so users can't drilldown into it.
 
Regards,
Ryan.
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