Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Conditional group SUM in Crystal Reports

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?

like image 374
Nathan Koop Avatar asked Oct 09 '09 20:10

Nathan Koop


People also ask

How do I sum two columns in Crystal report?

Place your data in detail section and take simmary in report footer, You can take that by right click ojn field and use insert summary option.


1 Answers

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.

like image 173
PowerUser Avatar answered Sep 30 '22 10:09

PowerUser