Calculated field (%) define parameters help

inq80

Registered User.
Local time
Yesterday, 16:08
Joined
Nov 14, 2015
Messages
39
Hi,

Has anyone come across this before?

I'm creating a report which displays the amount of calls we've received and who they are from.

Within the report I've got a field called "caller" and this info is pulled from the source query. Next to it I've got a field caller "callerCounter" which as suggests, give me a number of times that caller has called in.

This works fine.

I've also got a field "totalCounter" which displays the total number of calls received irrespective of the caller. Again works fine. The "callerCounter" works on a =count([calller]) expression, whilst the total works on a =DCount expression.

I'm now trying to get a third box to display the percentage.

I've used "=sum([callerCounter]/[totalCounter])*100" but every time i run the report it asks me to define the parameter for the two counters;

It's as if it's trying to calculate the percentage first before figuring out what the individual numbers are; how do i get it to work out the total and caller figures first before running the percentage sum?

If someone could point me in the right direction it would be appreciated.

Thanks
 
I don't see any reason for the Sum function. I think

Code:
=([callerCounter]/[totalCounter])*100

should give you what you want.
 
Last edited:
Hi Sneuberg,

perfect! Worked a charm.

How on earth are newbies suppose to know when not to use a function to perform a calculation?
 
using a DCount() for every record in your Query is not a good idea.
If you realy need it for some reason I prefer doing it once and store the value. You can store it as a publicVar (And read it into the query using a small function), in a field on one of the forms or in the registery (Again, using a function to read it)

As you create a report You don't need it at all.
Base your report on a SumQuery and sum the calls for each caller (Group by caller).
At the Report footer you put the TotalSumOfCalls of the calls. It can be =Sum(SumOfCalls). SumOfCalls is the sum of calls for eace caller, in the SumQuery.
Now you can refer in your report to the report's TotalSumOfCalls as a field and add a calculated field to each detail in the report =[SumOfCalls] / [TotalSumOfCalls] * 100
 

Users who are viewing this thread

Back
Top Bottom