# Non-commutative summary field on several grouping levels of a Crystal XI report.

I have multiple formulas that need to be repeated on all grouping levels of my report. i.e.

SUM{OtherNumber}, {GroupField1}) / SUM({RowTotal}, {GroupField1})
SUM{OtherNumber}, {GroupField2}) / SUM({RowTotal}, {GroupField2})
SUM{OtherNumber}, {GroupField3}) / SUM({RowTotal}, {GroupField3})

The formulas are non-commutative, so in the past I've a separate formula field for each groupng level.  this is a maintenance nightmare when I have 5 grouping levels, and 4 different fourmulas.

When I insert a simple summary field to a report, I can simply copy it to the other group footer.header and it adjust to that grouping level as appropriate. Is there a way to replicate this with a custom summarization?..Something like have one formula where the group parameter can determine the grouping of the section the object is on and mimic that behavior?  That way I would only have to create one formula field for each calcualtion and place it on the various headers.

SUM{OtherNumber}, CurentGroupField()) / SUM({RowTotal}, CurentGroupField())
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
Depending on what you are doing, i have done this with Weighted Average with. This can not work properly if you have nulls or a lot of zeros, but it has been great for me with things like percents and averages like what you describe.

I believe what I did is the following (don't have good sample at my current gig to play with, so this is from memory).

A detail field would contain your numerator / denominator calculation. Drop it on the report.
Right Click on that field, Insert summary, and choose Weighted Average With.
This will open up another drop down box for you to select a field.

It might work for your calculations perfectly, but definitely test it first with a side by side comparison.
0

Experts Exchange Solution brought to you by