Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Is it possible to insert a summary of a summary?


I have a Crystal report that has an inserted "average" summary for a field.  This populates on each row.

Is it possible to insert a summary that will do an "average" of the summaries described above?

Former Member
replied

OK. Assuming the above summary is a 'time' field,

1) Modify the first formula I provided above to:

whileprintingrecords;

numbervar secs := (hour({summary_field})*3600) + (minute({summary_field})*60) + second({summary_field});

numbervar avg := avg + secs;

numbervar x := x + 1;


The above formula should be placed on the same section as the other summary field

2) Modify the second formula to:

whileprintingrecords;

numbervar avg;

numbervar x;

local numbervar avg_secs := avg/x;

local numbervar Hours   := Truncate (avg_secs/3600);

local numbervar Minutes := Truncate (Remainder (avg_secs,3600)/60);

local numbervar Seconds := Remainder (avg_secs,60) ;

Totext (Hours,0,"") + ':'+ Totext (Minutes,0,"") + ':' + Totext(Seconds,0,"")


The above formula should go on the Group Footer


3) Create one last formula and place this on the Group Header for Location:


whileprintingrecords;

numbervar avg := 0;

numbervar x := 0;


-Abhilash


1 View this answer in context
Not what you were looking for? View more on this topic or Ask a question