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

Percentage reporting by groups 1

Status
Not open for further replies.

fieldtechuk

IS-IT--Management
May 12, 2006
11
Can anyone give me some advise. I have the following data in a table:

Location-code, call-number, type-of-call:
LOC1 0000001 START
LOC1 0000001 END
LOC1 0000002 START
LOC1 0000002 END
LOC2 0000003 START
LOC2 0000003 HOLD
LOC2 0000004 START
LOC2 0000004 END

For each call-number within location I need to work out the percentage of calls that have NOT been put on HOLD with an overall percentage at the end of the report i.e:

LOC1 100%
LOC2 50%

Overall 75%

I have tried various groups and running totals etc., but can't seem to get the right results.
 
Hi,

what version of CR do you use?

Referring to your example I would solve it as follows:

build a report with a group on location-code

Create the following running totals:
calls_per_loc: with formula type-of-call='START' and restore on group change
calls_total: with same formula but without restoring it
holds_per_loc: with formula type-of-call='HOLD' and restore on group change
holds_total: with same formula but without restoring it

Create the following formulas:
calls_per_loc:
if isNull({#calls_per_loc})
then
0
else
{#calls_per_loc}
Create identical formulas for the other running totals.
I would recommend to use only the formulas in the report, not the running totals itself.

Then create the formulas for the percentage:
loc_percentage:
({@calls_per_loc}-{@holds_per_loc})*100/{@calls_per_loc}
total_percentage:
({@calls_total}-{@holds_total})*100/{@calls_total}

In the group footer or for the total in the report footer you may place the group name or the string "Overall" and the according formula.

HTH
Barbara

Barbara Fuhrmann (Cologne, Germany) - Using Windows 2000/XP, Oracle 9i and Crystal Reports X
 
Hi Barbara
Many thanks - perfect!! I'm quite new to this, it was a great help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top