Joined: 11 Mar 2010
Location: United Kingdom
Online Status: Offline
Posts: 22
Topic: Grouping by Specific Data Posted: 12 Apr 2010 at 5:40am
I'm running Crystal Reports XI.
Bit of a tricky one (I think) I have a report that has a data field called suppliers and I need to be able to group specific customers together. So at the moment I can group all the invoices by their customer, but I need to be able to group them by a list of customer. So all the invoices for Customer A, Customer B, and Customr C need to be grouped together, and all the invoices for Customer D, Customer E, and Customer F need to be grouped together and so on and so forth.
Joined: 11 Jun 2009
Online Status: Offline
Posts: 26
Posted: 12 Apr 2010 at 6:05am
You could try creating a formula field that utilizes the Switch statement, then group on that.
eg. Switch('Customer A' in {mytable.customername} OR 'Customer B' in {mytable.customername}, '1','Customer C' in {mytable.customername} OR 'Customer D' in {mytable.customername}, '2')
Joined: 11 Mar 2010
Location: United Kingdom
Online Status: Offline
Posts: 22
Posted: 12 Apr 2010 at 9:58pm
Thanks very much, this works perfectly.
One other slight problem I'm having now is trying to sum a field that's already got a sum/maximum calculated in it. Any ideas/ways round the fact that Crystal won't let you do this? Basically I need to sum all the invoices in the group that I've just created.
Joined: 11 Jun 2009
Online Status: Offline
Posts: 26
Posted: 13 Apr 2010 at 2:37am
Haven't done much with summing, so I'm not aware of the issue you are referring to. The one work-around I can think of off-hand is create two new formula fields, set them equal to the respective summed fields, and sum the two new ones.
Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Posted: 13 Apr 2010 at 4:28am
I do not know a way of directly doing that. I have had several times to make my own specialized running totals using formulas and shared variables. I do not know if that would help you here.
Joined: 11 Mar 2010
Location: United Kingdom
Online Status: Offline
Posts: 22
Posted: 13 Apr 2010 at 9:51pm
Unfortunately not, I have also used those methods but they won't work in this case for reasons I won't go into. Anyway, the report has been given the ok so I'm happy Thanks for all your help.
I have another problem which I have posted as a separate topic if you can offer any assistance, I think it's a doozy.
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