1
votes

I'm using Crystal Reports 10 right now and I have my report almost finished. I have a group of customers and for each customer, I have multiple lines of customer information. The one thing I'm still trying to figure out though is how can I get a running total of one column's distinct values.

So, for example I have a customer Bob who has 6 different items. For each item, there is a manufacturer. It might be the same for all 6 items, it might be one for 3 of them and another for the other 3, or they might all be different. What I want is to have a field at the bottom of the group for Bob that would say:

Man1 - 3
Man2 - 1
Man3 - 2

with the manufacturer being on the left side and the number of items they make for that customer on the right side.

Is there anything in Crystal Reports that can do this right now? Or can someone give me some advice on where I would get started on a formula to do this? Thanks for any help you guys can give.

1

1 Answers

-1
votes

Need more information:

What kind of data structure are we talking about? How are the manufacturer and item data found? How are these related to the customer? How many manufacturers/items are typically found per customer?

If the manufacturer and items are two different fields, that might be simple (cross tab in customer group). If they are free form, that might be a problem. If there are separate fields for every manufacturer (I've see it happen), then that might be a problem.

Best scenario: One field for manufacturer, one field for item, distinct relation to customer.
Possible solution: Group by customer, sub-group by manufacturer, count of items.

Not best scenario: Table for customer, separate table for each manufacturer.
Possible solution: Main report, group by customer. Linked subreport on Manufacturer/items.

Worst scenario: Free-text entry of manufacturer and items in a memo field.
Possible solution: Redesign your database (grin).

If you have to, you can do this using logic tests through formulas, but if you have many manufacturers/items, it would get exhaustive.

Best answer: More information.