Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: field cannot be summarized + Crystal Report Post Reply Post New Topic
Author Message
Bobby3
Newbie
Newbie


Joined: 04 Jun 2009
Online Status: Offline
Posts: 6
Quote Bobby3 Replybullet Topic: field cannot be summarized + Crystal Report
     Posted: 04 Jun 2009 at 6:30am
Hi All, I know this is .Net forum, but I found couple of Crystal report posting on this so I am also posting one issue I have.

I am using Crystal Report 11. I have one formula which calculate total Commission. Now I want to sum all the commisions but I am getting, 'field cannot be summarized' error. Any help .....

@Commision = Sum ({tablename.Commition})
than
@TotalCommision = Sum({@Commision})

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Jun 2009 at 7:43am
You cannot SUM a SUM.
I assume youa re trying to get sums at 2 differnet grouping levels...
maybe @commision is summing at group 1 and @totalcommision is a sum for the report.
If this is the case don't bother with a formula for these but if you really want to your @commision would be
Sum ({tablename.Commition},grouplevelfieldhere) placed on GH or GF and
@totalcommision is Sum ({tablename.Commition}) placed on RH or RF.
 
 
Easier to just use the Summary function. Click on it, select the field to summarize (Commition), select SUM and set at group level 1. repeat and select grand total for all.
If I was incorrect in my assumptions about what you were trying to do please post more details for more help.
IP IP Logged
Bobby3
Newbie
Newbie


Joined: 04 Jun 2009
Online Status: Offline
Posts: 6
Quote Bobby3 Replybullet Posted: 04 Jun 2009 at 9:27am

I am showing Commision (Calculated by field of table) at Details. Than in a group footer I want to sum commision.

Exp. - Need to calculate Revenue and I am using following formula -
         @Revenue =  Sum ({TB.APPREV})
Using this at detail pan.
 
Now want to sum this calculated Revenue
          @TotalRevenue = Sum ({@Revenue})
And using this into GF1.
 
Thank you for your reply, and I hope this time I explain well.
 
Bobby
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Jun 2009 at 10:14am
Sorry, I can't really follow what you are trying to accomplish here.
Your first formula @Revenue =  Sum ({TB.APPREV}) is going to give you a total of the apprev field for the entire report.
So your second formula @TotalRevenue = Sum ({@Revenue}) is trying to give you a Sum of the original SUM which does not really make sense?
I think you may need to start back at square one here and post some sample data and some sample of what you want to calculate from it.


Edited by DBlank - 04 Jun 2009 at 10:14am
IP IP Logged
Bobby3
Newbie
Newbie


Joined: 04 Jun 2009
Online Status: Offline
Posts: 6
Quote Bobby3 Replybullet Posted: 04 Jun 2009 at 11:30am
Employee      Pay Rate     Revenue    Commission      Gross Cost
AAA               45               1000          500                   1100
BBB               54                 700          200                     800
CCC              68               1200          800                    3000
                                  Total Revenue    Total Commission   Total Gross 
 
Here Revenue, Commission and Gross Cost are coming throuth formula like I post earlier. Now I want Total Revenue, Total Commission and Total Gross summing associated columns.
 
For Revenue I used    SUM ({TB.CAPREV}), so it is showing 1000, 700, and 1200 now I want GRAND total for Revenue ie 2900.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Jun 2009 at 11:52am
In your example are each of these rows a sub report?
I ask this because the straight formula of SUM ({TB.CAPREV}) without sub reports should already be 2900. In the above example if there are no subreports and assuming you are grouping on the employee name here the formula of SUM ({TB.CAPREV},{TB.EmployeeField}) would give you the results the 3 seperate results of 1000,700,1200.
If you used the summary function in crystal to make the sum_field and you move that around in your report from group level to group level it autmatically changes itself for grouping.
Assuming your data is more like:
Employee      Pay Rate     Revenue    Commission      Gross Cost
AAA               45               800          100                   600
AAA               45               150          200                   500
AAA               45               50            100                   100
but you want it to look like
Employee      Pay Rate     Revenue    Commission      Gross Cost
AAA               45               1000          500                   1100
BBB               54                 700          200                     800
CCC              68               1200          800                    3000
                                  Total Revenue    Total Commission   Total Gross 
 
 
Group on Employee field.
Highlight Revenue field. Click on SUmmar Function. Set Summary to SUM at Group Footer 1.
Repeat for except set Summary at Grand total (Report Footer).
Repeat both steps but use the Commision field.
Repeat again with Gross cost field.
IN your report deisgn move the totals that were in the group 1 footer to the group 1 header.
suppress the detail section.
preview and see if that is what you wanted.


Edited by DBlank - 04 Jun 2009 at 11:53am
IP IP Logged
Bobby3
Newbie
Newbie


Joined: 04 Jun 2009
Online Status: Offline
Posts: 6
Quote Bobby3 Replybullet Posted: 04 Jun 2009 at 12:39pm

I really appreciate your effort, but I am still struggling. Actually I am trying to update this report I did not really design this report. The way you are telling I did in that way couple of reports. But in this case I have to use these formula fields’ @Commission etc for grand total. Well let me try again.

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Jun 2009 at 1:05pm
No problem. Working on someone else's report can be confusing.
Just look into the processes here.
To help you disect your report, the formula that uses the SUM of a field returns and displays the full value of all of those fields, it is not incrementally displaying the addition of row to row. That is usually a variable or a Running Total field. Therefore a formula field that is written as "SUM(table.field)" would show you the exact same number regardless of where you place it in the report (report header, report footer, group header, detail row, whatever).


Edited by DBlank - 04 Jun 2009 at 1:06pm
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