6 Replies Latest reply on Mar 3, 2009 8:26 PM by deliciousapple

# Sub-Summary in calculations

### Title

Sub-Summary in calculations

### Post

I need to calculate closing percentages in summary rows.

I have been able to use the getsummary function and calculate a closing percentage for all records showing in a report.   I would like to do this for summary rows as well.

Example:

If I have 45 records showing in a report, I might have it broke down into three cities, (sub-summaries)

Seattle has 20 appointments, 5 sales

Lacey has 15 appointments, 2 sales

Olympia has 10 appointments, 3 sales

How do I get a simple close percentage per city? example i would want to see a field that says 25% for seattle

I have the total close percentage for all records showing on the report, in this example I would see a 22.22% closing percentage on all appointments.

My summary field for total appointments is "count_date"

My summary field for sales is "count_sale_gross"

ideas????

• ###### 1. Re: Sub-Summary in calculations

Try:

GetSummary (  count_sale_gross ; city ) / GetSummary (  count_date ; city )

• ###### 2. Re: Sub-Summary in calculations

Comment, works great!

Now what if I want to have summary views by other categories, besides cities.

Say I look at my sales report by product, and I want to know how well I am closing (selling) a product.  Do I have to create a new GetSummary field for each sub-summary view I have?

• ###### 3. Re: Sub-Summary in calculations

You need a calculation field for each breakfield you want to sub-summarize by. If you want a similar percentage by product, then the calculation must be =

GetSummary (  count_sale_gross ; product ) / GetSummary (  count_date ; product )

• ###### 4. Re: Sub-Summary in calculations

thanks comment, i have it setup and all is good.

One question,

all fields used in the GetSummary calculation have to reside in the same table?

thanks again

• ###### 5. Re: Sub-Summary in calculations

DeliciousApple wrote:

all fields used in the GetSummary calculation have to reside in the same table?

Unfortunately, that is so. I don't know why, since if you want your breakfield to come from a related table, you can easily overcome the limitation by defining a local calculation field =

Related::BreakField

and use that as your breakfield.

---

Note that the same breakfield must be used in all these three: the sub-summary part definition, the GetSummary() calculation, and the sort order.

• ###### 6. Re: Sub-Summary in calculations

got it, thanks.

and thanks for the "note", that would of drove me nuts trying to figure out why the local calculation field didn't work properly.  I'll make the changes to the three stated areas.