Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Group summary multiples conundrum! 1

Status
Not open for further replies.

zootweller

Technical User
Oct 7, 2001
46
GB
Hi

I have a call management report detailing all active calls by group name.
<GH1> - this summarises the number of calls by groupname into age ranges of (a)0-3days old, (b)4-10days, (c)11days-1mnth and (d)1month+.
<GH2> - displays each 'incident' or call reference (and related fields) - I have added 4 formulas here to display '1' if the call falls into one of the age ranges as stated above.
<Detail> - this shows the audit trail for each 'incident'.

Problem - when summarising the group total for each age range in GH1, it multiplies each entry by the number of Detail records returned.. it should only return '1' maximum for each 'Incident' (so I hoped).
It works when I drop the audit trail, but I'm asked to provide a drill-down view...
I have tried various approaches here, including initially trying to divide the age result by the number of detail records returned, then summarising that figue, to no avail.
I am using old v7 btw.
Any guidance would be most appreciated.
Thanks in advance.

Paul
 
Use a running total field, not a summary operation.

Insert, field object, running total field, pick your field to summarize, then evaluate on change of group (as opposed to every record) and reset on change of group.

If you have questions, please let me know.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
In newer versions you'd use a distinct count of the Incidents for the Age group, CR 7 may not have that choice.

A 3 formula approach would then make sense:

GH1 formula
@Init Incident Init
whileprintingrecords;
numbervar Inc_cnt:=0;

Details Formula
@Init Incident Cnt
whileprintingrecords;
numbervar Inc_cnt;
If {Table.incident} <> previous({Table.incident}) then
Inc_cnt:=Inc_cnt+1;

GF1 formula
@Init Incident Disp
whileprintingrecords;
numbervar Inc_cnt

This will display the number of unique Incidents at the Group Header 1 level.

-k
 
Thanks synapsevampire - your advice has nearly got me there... Problem now is that CR will no longer allow me to create a running total field on the age-group formulas. Error: 'a summary has been specified on a non-recurring field'.
eg. @1monthplus previously read:'If CurrentDate - {INCIDENT.DATE_LOGGED} >= 31 Then 1 Else 0', if true, it returned a '1' for each detail record, so the group summary multiplied. I amended it to read: 'If CurrentDate - {INCIDENT.DATE_LOGGED} >= 31 and {Incident.INCIDENT_REF} <> Previous({Incident.INCIDENT_REF}) Then 1 Else 0' which looks fine but get the above error and cannot summarise it now at all..
Also, the @Init Inc cnt formula returns blank on the initial record returned, so cannot be calculated.
Is there a way I can get around this problem? As stated my biggest hurdle is getting CR to accept the summary....

help much appreciated, once again!
 
Try using the three formula method instead of your aging formulas. I would adapt SV's formulas like this:

//GH1 formula
//{@Init Incident Init}:
whileprintingrecords;
numbervar Inc_cnt03 := 0;
numbervar Inc_cnt410 := 0;
numbervar Inc_cnt1130 := 0;
numbervar Inc_cnt31 := 0;

//Details Formula
//{@Init Incident Cnt}:
whileprintingrecords;
numbervar Inc_cnt;numbervar Inc_cnt03;
numbervar Inc_cnt410;
numbervar Inc_cnt1130;
numbervar Inc_cnt31;

If onfirstrecord or
{incident.INCIDENT_REF} <> previous({Incident.INCIDENT_REF}) then
(
if currentdate - {INCIDENT.DATE_LOGGED} < 4 then
Inc_cnt03:=Inc_cnt03+1;
if currentdate - {INCIDENT.DATE_LOGGED} in 4 to 10 then
Inc_cnt410 := Inc_cnt410 + 1;
if currentdate - {INCIDENT.DATE_LOGGED} in 11 to 30 then
Inc_cnt1130 := Inc_cnt1130 + 1;
if currentdate - {INCIDENT.DATE_LOGGED} >= 31 then
Inc_cnt31 := Inc_cnt31 + 1;
)

GF1 formulas:
{@Inc_cnt03 Disp}:
whileprintingrecords;
numbervar Inc_cnt03;

{@Inc_cnt410 Disp}:
whileprintingrecords;
numbervar Inc_cnt410;

{@Inc_cnt1130 Disp}:
whileprintingrecords;
numbervar Inc_cnt1130;

{@Inc_cnt31 Disp}:
whileprintingrecords;
numbervar Inc_cnt31;

For this to work properly you must sort the records by
{Incident.INCIDENT_REF}.

-LB
 
Thanks LB - seems you solved it.
Much appreciated!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top