cancel
Showing results for 
Search instead for 
Did you mean: 

Sum() By Part of Field Value

Former Member
0 Kudos

Using Crystal XI (with all the patches)

In my table/view I have a field called "Bill_Item" which has values such as "AAA111", "AAA477", "BAA985", "BBC287" etc.

I know I can sum based on the field like this:

Sum({Table1.Amount}, {Table1.Bill_Item})

But what I really need is more like this:

Sum({Table1.Amount}, Left({Table1.Bill_Item}, 3))

Is there a way of doing this? (other than the way I wrote it above which throws an error)

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Create a formula

@subPart

Left({Table1.Bill_Item}, 3)

Group on this formula

The use formula

Sum({Table1.Amount}, ({@SubPart})

Ian

Former Member
0 Kudos

Thanks.