user2966249
user2966249

Reputation: 3

Crystal Reports : combine and sum two fields if another field is a duplicate

i have been having trouble for a while figuring this out. I am looking to combine the rows that have duplicate "materials" and in doing so sum up the quantities of each and the prices.

Material   qty   unit price
a               5       20.00
a               5       20.00
b               2         5.00
c               1         5.00

and to get it like

Material   qty  unit price
a             10     40.00
b               2       5.00
c               1       5.00

Ive looked and found similar questions but couldnt figure it out. sorry if its a repost. Thanks

Upvotes: 0

Views: 3930

Answers (2)

campagnolo_1
campagnolo_1

Reputation: 2750

Create a Group based on your Material field and then insert a summary by right-clicking on your qty field -> Insert Summary. If you can't (or don't want to) group, then you will have to create running totals to summarize your different materials.

Upvotes: 0

chrj15
chrj15

Reputation: 51

When you begin creating the report, one of the first options is grouping, followed by aggregates (sum, count etc.). Once you finish the report wizard, suppress the details and the group headers.

Upvotes: 1

Related Questions