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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CR9 Running Total Summary from a Formula Field 1

Status
Not open for further replies.

PDAnalyst

Technical User
Dec 2, 2005
72
US
Hi,

Afternoon All,

I am using CR9 with an ODBC connection to a MS SQL database.

I have a pretty large report (which I had used sub-reports before but it could not handle the size of the report)where I use Running Total Formulas within each group to calculate time spent on each call. When I try to sum the Formula down to the groups it will not let me because I am using a running total with the formula. (annoying you cannot summarize this filed error)

Is there any way that I can sum it down?

Here is how the report looks like and the fields invoved:

I have created an upper level grouping for each military hour of the day, then under this another group by the Priorities of the Calls, the under that grouped by each unique call number. I had to create a group for each incident number due to the fact that I have multiple units that respond to the same incident number and I have to calculate how many minutes each of these units spent. Under the incident number is the unique unit number.

I created a formula field (@BackupUnit_difference) that calculates the time spent by each unit for that call and another formula (@BackupUnitSum) that creates a running total for the amount of total time spent on this call.

The problem happens when I try to sum all of the (@BackupUnitSum)'s for the Total by each Priority. It just will not let me create a sum of the formula field. I need to add all of the running totals for each Incident numbers for each priority as well as for each hour group.

Any suggestions?

Here is the hierarcy:

- Calls received time Group
- Incident Number Group
- Unit ID number Group

Here is the formula that creates the running total for each incident number (this correctly calculates the total time spent for all units at that call) //{@Back-up_Unit_SUM}
NumberVar BupUnitTotal;
If OnFirstRecord
Then BupUnitTotal := {@Backup_unit_difference}
Else BupUnitTotal := BupUnitTotal + (@Backup_unit_difference}

Here is the formula that I tried to create in order to sum all of the running totals for each incident (Which does not work)
NumberVar BupUnitGrandtotal;
BupUnitGrandtotal := {@Back-up_Unit_SUM} - {@Backup_unit_difference};

I also tried this formula to sum all of the BupUnitSums but the error comes stating that I cannot summarize that field
NumberVar BupUnitPriorityTotal;
BupUnitPriorityTotal := sum({@Backup_unit_Sum},{cfs_core.incident_num})

Any help is greatly appreciated,

S. Egilmez


 
For each group level, use a different variable that is reset in the group header for that level. So you would create an accumulation formula like:

whileprintingrecords;
NumberVar BupUnitTotal := BupUnitTotal + {@Backup_unit_difference};
Numbervar PriorityTot := PriorityTot + {@Backup_unit_difference};
Numbervar HourlyTot := HourlyTot + {@Backup_unit_difference};

In the group header for Priority, place:
whileprintingrecords;
Numbervar PriorityTot := 0;

Do a similar formula resetting the Hourly Total for the hourly header.

Then place display formulas in the footer for the particular group, as in:

whileprintingrecords;
numbervar priorityTot;

-LB
 
Lbass,

IT WORKS!!!,

you again saved my bacon.

I nearly spent 2 days trying to figure this out and you solved all my headaches.

Thanks again for all of your help,

I appreciate it,

S. Egilmez
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top