Search code examples
crystal-reports

Summing by Department with conditional sum


My income statement requires a column for each department in our business. Each of my six departments have their own Sales, Cost of Sales, Gross Profit, Overhead, and Net Income.

The view from the database contains columns for GL Number, Department Number, and Amount for every transaction. I can tell if its Sales, Cost of Sales, etc from the identifying GL Number. I am able to get all of the pertinent information from one view, however I don't know how to arrange it on the report.

I created an initial version in Excel using the Sumifs function. How can I get the same arrangement of data in Crystal Reports?


Solution

  • Running Totals can be configured to only count records that meet given criteria. When creating the RT, select "sum" as the type of summary and "Use a Formula". In the "x-2" screen, write logic to filter out anything that doesn't meet the criteria you want.