Skip to Content
avatar image
Former Member

SAP Crystal Sum of Sub Group Totals

  • 1)Red boxes are group 2 headers which are weighted average of all the values in detail section (body)
  • 2)I need sum of these three red boxes in place of black box (i.e. group header 1)
  • 3)If I simply insert ‘Total’ and keep it as sum it will sum all the instances of detail section as well, but my requirement is only sum of weighted average in sub group.
group-sum-issue.png (105.6 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    Feb 08, 2017 at 11:41 AM

    Unsuppress the eval formula and see what is being calculated.

    OOPs my mistake change @eval to

    Global numbervar subtotal:= subtotal+(whatever your summary function is) eg Sum(Nummericfield, Accountnumbergroup field)

    Ian

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 08, 2017 at 09:40 AM

    Use a Variable to add together

    You need 3 formula

    @Reset place this in groupheader 1 and suppress

    Whileprintingrecords;

    Global numbervar subtotal:=0

    @Eval place this in groupheader 2 and suppress

    Whileprintingrecords;

    Global numbervar subtotal:= (whatever your summary function is) eg Sum(Nummericfield, Accountnumbergroup field)

    @Display place this in groupfooter 1

    Whileprintingrecords;

    Global numbervar subtotal;

    Ian

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 07, 2017 at 09:11 PM

    Hi Naoman,

    Are these subtotals summary fields or are they formulas? If they are summmary fields then you can copy that field into Group Header 1. From what you've said this doesn't sound like it's the case.

    If they are a formula then you should be looking at using a Running total to calculate the subtotals and having them roll into the total. The problem with running totals is you can't have the total in Group Header 1, it would have to go into the Group Footer 1 because Crystal calculates formulas left-right, top to bottom. It can't calculate a formula and then pass the results to a section above it.

    Brian

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 07, 2017 at 08:52 PM

    Kindly Help

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 08, 2017 at 01:27 PM

    Yes Sir, I did work. Thanks you so much.

    Add comment
    10|10000 characters needed characters exceeded