5

I've been doing some accounting reports and have been summing up my different currencies using a formula

IE

CanadianCommissionFormula

if {myData;1.CurrencyType} = "CDN" then
    {myData;1.Commission} 
else
    0


CanadianCommissionSum

SUM({@CanadianCommissionFormula})

Then I'd just display the CanadianCommissionSum at the bottom of the report and things were great.

I've just come across the requirement to do this, but grouped by Sales Rep. I tried using my previous formula, but this sums for the whole report. Is there an easy way to sum like this, based on which group it's in?

3 Answers 3

10

You probably figured this out a year ago, but just in case, try this:

  1. Change your CanadianCommissionSum formula to

    SUM({@CanadianCommissionFormula},{SalesRep})

  2. Put this formula in your SalesRep's Group Footer section.

This should now display properly.

1
0

Create a group based on the sales rep in the Crystal Report, and place the:

SUM({@CanadianCommissionFormula})

...in the footer of the group.

8
  • that, unfortunately gives me the sum for all the sales reps Oct 9, 2009 at 20:36
  • Then you aren't grouping by sales rep, or the sales rep info isn't what you think it is.
    – OMG Ponies
    Oct 9, 2009 at 21:07
  • When I look at the Group Expert I see the field SalesRep in the "Group By" portion. Then, using the formulas I've got listed above, I add the formula from your answer in the GroupFooterSection1 area, it then displays the total SUM for all Canadian Commissions, not the individual rep. Oct 9, 2009 at 21:18
  • So on the report, you see a group header above the details section, and the corresponding group footer underneath - the formula is in the group footer section...
    – OMG Ponies
    Oct 9, 2009 at 21:28
  • Is any other data relating to sales rep coming out properly in the grouping?
    – OMG Ponies
    Oct 9, 2009 at 21:29
0

I would assume that rexem's suggestion should work but since you said it gives you a total all of the sales reps you could change the sum to running total. Before doing this I'd double check that you have your field in the correct footer section though.

To do the running total, group by Sales Rep, and then set up your running total to evaluate on every record and reset on the change of the group. Then you can put this running total in the group footer and it will show subtotals.

Hope this helps.

3
  • how do I get it to reset on the change of the group? Oct 9, 2009 at 21:03
  • You can setup running totals through functions, or use the Running Total feature in the same widget where you list the functions/etc.
    – OMG Ponies
    Oct 9, 2009 at 21:10
  • When you set up the new running total field you will see a "Reset" section which is where you set it to "On change of group" and then select your group. This will reset the field back to zero every time that group changes.
    – Dusty
    Oct 9, 2009 at 22:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.