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

Getting % in group

Status
Not open for further replies.

malka

Programmer
Jun 17, 2001
12
US
I have a report that give summary and count in all the group levels and a grand total for each variable.
I will need % of few variables in one of the groups.
Here a short sample.
I have a table of after hours calls.
Groups - Account number, monthly.
At the monthly group - I have total calls for each call taker(2 variables-2 call takers) and the total calls for this company for the month.
I need to calculate the % for each call taker of the total monthly calls, as well as the % at the end of report according to the date parameters that I have provided.

My variables are:
if trim({HickoryMyrnaCalls.CallTaker}) = "H" then
1

And the total for this is a summary of this variable in the month group.

How do I perform the calculation for the %

I hope my question is understood.

Thanks in advance for any reply.

MS.
 
For Crystal 8.5, you get percentages by writing Formula fields with a command like
ValA % ValB

Thus if ValA is 10 and ValB is 40 you get 25%.

Placing these at group level should get you a group percentage. Or is there some other additional problem that is stopping you doing this?

Madawc Williams
East Anglia, Great Britain
 
Let's call your above formula {@Hcalls}. Then the percent of H's calls within the month would be calculated as follows:

sum({@Hcalls},{table.date},"monthly")% count({@Hcalls},{table.date},"monthly")

At the report level, the total % of H's calls would be:

sum({@Hcalls}) % count({@Hcalls})

If you wanted the % of all monthly calls compared to all calls during the parameter period, then use a running total for each month, e.g., {#Jan} would be created like this: Select {@Hcalls}, count, evaluate based on a formula:
month({table.date}) = 1 //for January or if there could be more than one year represented, use a date range

Reset never. Then create a formula for each month:

{#Jan}%count({@Hcalls})

You could use any recurring field in the denominator instead of {@Hcalls}, but {@Hcalls} works, too, because it evaluates for each record.

-LB
 
Thanks for the quick reply from Madawc Williams and -LB. With your directions I was able to create the % in the monthly group and in the total.

MS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top