cancel
Showing results for 
Search instead for 
Did you mean: 

How to have Report Grand Total add up the values of a group summary field containing a formula

Former Member
0 Kudos

I am using a formula at the group level to display a total based on varyingcriteria.  In some instances, it will pull an average number and in others, it will sum up other summary fields in the group.  Therefore, it does not make sense to sum the orgiginal detail field in the grand total.  I need to take all the results from my formula summary field and add them up in the report total.

Is there a way to do this?  I have seen postings about putting formulas in the report header and then iin report footer about 'WhilePrintingRecords'  But not sure I understand the steps involved.  Please help with some specific detail.

The formula in my group field that I need to total at the report level:

if {@NBVerify} = TRUE then (Sum ({@Benchmark NB}, {@fullname}))*(({?End Date}-{?Start Date})/({?Average Calc}*30)) else Sum ({@Scheduled Count}, {@fullname})+Sum ({@Open Count}, {@fullname})+Sum ({@Hold Count}, {@fullname})

Thanks for any help.

Accepted Solutions (0)

Answers (1)

Answers (1)

abhilash_kumar
Active Contributor

Hi John,

Modify the formula to:

whileprintingrecords;

numbervar subt := if {@NBVerify} = TRUE then (Sum ({@Benchmark NB}, {@fullname}))*(({?End Date}-{?Start Date})/({?Average Calc}*30)) else Sum ({@Scheduled Count}, {@fullname})+Sum ({@Open Count}, {@fullname})+Sum ({@Hold Count}, {@fullname});

numbervar gtotal := gtotal + subt;

subt;

Create another formula with this code and place this on the Report Footer:

whileprintingrecords;

numbervar gtotal;


-Abhilash

Former Member
0 Kudos

That worked - thank you for the fast reply!  You are very helpful.

If I need to do the same for another summary field in the same report, do I need to rename a part of this formula?  Can you explain a little bit of what exactly this formula/code is doing?

abhilash_kumar
Active Contributor
0 Kudos

The formula simply keeps adding values on the group footer in the gtotal variable.

The other formula just displays what's stored in the gtotal variable.

-Abhilash

Former Member
0 Kudos

So if I want to add another instance in the same report, I just need to rename the next variable gtotal2?

abhilash_kumar
Active Contributor
0 Kudos

Yes, you just need to use another variable name.

-Abhilash

Former Member
0 Kudos

Thanks again for your help