Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Customized Grouping Post Reply Post New Topic
Author Message
Bill
Newbie
Newbie
Avatar

Joined: 14 Dec 2007
Location: United States
Online Status: Offline
Posts: 6
Quote Bill Replybullet Topic: Customized Grouping
     Posted: 14 Dec 2007 at 10:17am
Here is my problem: I have 3 categories of items amount that I can get subtotal and total. Now how could I subtotal every category but only total the first two categories:
======================================
   id amount
Category 1:    
    15   5
    13   10
    18   25
    15   100
Sutotal 140
Category 2:    
    17   10
    1    10
    3    10
    8    100
Sutotal 130
Total    270

Category 3:    
     1   1
     2   2
     3   2
     4   6
Sutotal 11

As I am very new with Crystal Report, your help is very much appreciated. This needs to be done by CR10.
Thanks,
Bill
IP IP Logged
Lugh
Senior Member
Senior Member
Avatar

Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
Quote Lugh Replybullet Posted: 14 Dec 2007 at 11:17am
There are two possible approaches here, and both will involve using a formula.

One is to create a conditional sum.  Essentially, create a formula, say @Cat1Cat2, that looks like:

IF {MyCategory} IN ["Category1","Category2"] THEN {MyAmount}
ELSE 0

Then, put a summary field in the Report Footer that sums @Cat1Cat2.  This summary will ignore Category3, as all of those records go to 0.  Do note that this puts your total at the end of the report, not between Category2 and Category3.


The other approach is to add another level of grouping.  In this case, make @Cat1Cat2 look like:

IF {MyCategory} IN ["Category1","Category2"] THEN "Needs Total"
ELSE "Do Not Total"

Then, create a group based on @Cat1Cat2.  You can put a summary field in the Group Footer, and suppress the Group Footer for the "Do Not Total" group.


IP IP Logged
Bill
Newbie
Newbie
Avatar

Joined: 14 Dec 2007
Location: United States
Online Status: Offline
Posts: 6
Quote Bill Replybullet Posted: 18 Dec 2007 at 10:00am
Thanks for your help Lugh. I did accomplish what I need with you help.
Thanks,
Bill
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