A
A
A
A
B
B
Avg.
Name
1
2
3
4
1
2
xxxxxxxxxxx
12/16
90
100
85
10/8
100
--
xxxxxxxxxxx
20/16
93
5/8
100
--
xxxxxxxxxxx
16/16
89
90
16/8
95
--
Avg.
--
--
--
--
--
--
--
Greetings,
I have a matrix that looks similar to the table above with two row groups and one column group. Does anyone know a way to manually do column and row based averaging without using the avg() function -as the data is not numerical?
Thanks
Hi,
Please try
1. converting the non numerical to numerical by using cdbl. and then use avg.
2. if it is not possible to use cdbl, then use sum in scope of that particular group and dicide by rownumber of that group.
say : sum(abcd,"Group1")/rownumber(group1)
|||Hey, thanks for the reply. Not all fields are numeric in this case. I just need to avg. the numeric values. A quick test revealed that the report is generated left to right top to bottom. It seems that I will need to keep a tally of the total in code. The problem is that point where the variables should reset is not always the correct place. For example -
This only handles row based not column based havent even started that.
private iRowCount as Integer
private iRowSum as Double
public Function DisplayDataCell(Score as String, InRowGroup as Boolean, InColumnGroup as boolean, IsNumber as boolean)
dim Result as String
dim Avgerage as Double
Result=""
if (not IsNumber) then
Result=Score
else if (InRowGroup and InColumnGroup) then
iRowCount=iRowCount+1
iRowSum=iRowSum+CDbl(Score)
Result=Score
else if not(InRowGroup)then
Average=(iRowSum / iRowCount)
iRowSum=0
iRowCount=0
Result=CStr(Avegerage)
end if
Return Result
end function
The problem is the point where the values are being reset is not always working out for me. I know I am doing something wrong. When you say use rowcount and columncount where should I use these values to return the avg?
not InRowGroup and not InColumnGroup.
Thanks,
No comments:
Post a Comment