4 Replies Latest reply on Dec 13, 2012 10:30 AM by comment

# Can a GetSummary ( summaryField ; breakField )script has more than one breakField?

I have a calculation field "Delta" defined with the below formula.

Delta = GetSummary ( SUM_curFiscYearAmount; Event_category) - GetSummary ( SUM_prevFiscYearAmount; Event_category ) .

This field only displays on a summary report when it is sorted by "Event_Category". Is there a way to incorporate other breakfields in this script so that the "Delta" field would display on the summary report regardless of the sort? Your help in this would be much appreciated. Thanks.

• ###### 1. Re: Can a GetSummary ( summaryField ; breakField )script has more than one breakField?

Short answer: No, the GetSummary() function will not work if records are not sorted by breakfield.

Longer answer: Perhaps if you explained what exactly you are trying to achieve, another way could be found.

---

BTW, this is a calculation, not a script.

• ###### 2. Re: Can a GetSummary ( summaryField ; breakField )script has more than one breakField?

As Michael says... "No"...

But you can get a breakdown by the second sort criteria as well as the first. You are sorting by Event_Category. If you sorted by Event then Category you could create summary calculations which reflect each. You could sort by Event Then Category Then Event_Category if you wanted to use an Event_Cateogry summary part etc.

- Lyndsay

• ###### 3. Re: Can a GetSummary ( summaryField ; breakField )script has more than one breakField?

Thank you very much, Michael & Lindsay for your response.

I was trying to show the change between the current fiscal year revenue and the previous year revenue on a summary report.  This was how I originally defined Delta.

Delta = curFiscYearAmount - prevFiscYearAmount             (calculation)

SUM_Delta = Total of Delta       (summary)

and the result of SUM_Delta on the summary report came out strange.  Appreciate if could point where I go wrong here.

-----------------

I ended up using GetSummary calculation below and define a breakfield

Delta = GetSummary ( SUM_curFiscYearAmount; Event_category) - GetSummary ( SUM_prevFiscYearAmount; Event_category )

The result of the Delta here came out fine sorted by Event_category.

My question was whether the GetSummary calculation can incorporate more than one breakfield within that calculation which Michael had said no.  I can sort it again under a different sort after the summary report display with the Event Category Sort as Lindsay suggested.

Thanks both  for your patience.

• ###### 4. Re: Can a GetSummary ( summaryField ; breakField )script has more than one breakField?

gnowc wrote:

This was how I originally defined Delta.

Delta = curFiscYearAmount - prevFiscYearAmount             (calculation)

SUM_Delta = Total of Delta       (summary)

and the result of SUM_Delta on the summary report came out strange.  Appreciate if could point where I go wrong here.

I am not sure we have enough details here. I think that the summary field (Total of Delta) should return the same result as the calculation field =

GetSummary ( SUM_curFiscYearAmount; Event_category) - GetSummary ( SUM_prevFiscYearAmount; Event_category )

provided that:

(1) Records are sorted by Event_category;

AND

(2) The summary field is placed in a sub-summary by Event_category part.