Search code examples
crystal-reportsgrouping

Crystal Reports - add results of grouping together


Really low level question, but it's been 5 years since I used Crystal Reports and I want to ensure that before I think about using it again that it would be suitable - I think it will.

I have two groups of data - Group 1 is Income, Group 2 is Expenses. I am looking to create a Profit result by a formula to take the sum of Group 2 away from the sum of Group 1. If I recall this is quite straightforward, but just throwing this one out there to begin with.

Thanks


Solution

  • are income and expenses 2 different values of the same field in the database? If so, create a formula like below to storage Income and expenses total values and place it on your group footer

    if {database your field} = "Income" then numbervar Income := {your group total} else numbervar Expenses := {your group total}

    Then subtract them in a second formula placed on your report footer(numbervar Income - numbervar Expenses)