Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Grouping by Specific Data Post Reply Post New Topic
Author Message
MrCastalum
Newbie
Newbie
Avatar

Joined: 11 Mar 2010
Location: United Kingdom
Online Status: Offline
Posts: 22
Quote MrCastalum Replybullet 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.

Any ideas?
IP IP Logged
delstar
Newbie
Newbie


Joined: 11 Jun 2009
Online Status: Offline
Posts: 26
Quote delstar Replybullet 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')
IP IP Logged
MrCastalum
Newbie
Newbie
Avatar

Joined: 11 Mar 2010
Location: United Kingdom
Online Status: Offline
Posts: 22
Quote MrCastalum Replybullet Posted: 12 Apr 2010 at 9:58pm
Thanks very much, this works perfectly. SmileThumbs%20Up

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.

Thanks again.
IP IP Logged
delstar
Newbie
Newbie


Joined: 11 Jun 2009
Online Status: Offline
Posts: 26
Quote delstar Replybullet 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.
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet 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.
IP IP Logged
MrCastalum
Newbie
Newbie
Avatar

Joined: 11 Mar 2010
Location: United Kingdom
Online Status: Offline
Posts: 22
Quote MrCastalum Replybullet 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 Smile 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. Smile

http://www.crystalreportsbook.com/Forum/forum_posts.asp?TID=9680&PID=30740#30740


Edited by MrCastalum - 13 Apr 2010 at 9:52pm
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