How to use variable to calculate a percentage from the sum
Hi,
I tried many different ways to use a variable to calculate the percentage of
a record from the sum of that column but can't get it to work. Let's say I
have a list of travel expenses, I wanted to find out the percentage for each
of them.
$50 33% ($50/150)
$40 27% ($40/150)
$60 40% ($60/150)
-----
$150 (group footer)
I also tried the look ahead option and still not giving me the incorrect
result. It's returning the same value for all record which is 40% in this
case, Thanks.
I tried many different ways to use a variable to calculate the percentage of
a record from the sum of that column but can't get it to work. Let's say I
have a list of travel expenses, I wanted to find out the percentage for each
of them.
$50 33% ($50/150)
$40 27% ($40/150)
$60 40% ($60/150)
-----
$150 (group footer)
I also tried the look ahead option and still not giving me the incorrect
result. It's returning the same value for all record which is 40% in this
case, Thanks.
This discussion has been closed.
Comments
first you have to have a twopass report.
At the end of the first pass you should store the values of the
calculated sum's to some var's (OnEndFirstPass/mySummary). In the
second pass the values are calculated; the percentage values with the
stored totals of the first pass (myVar :=
(100/mySummary)*CurrValueField)....
HIH
ralf