I am using the following code in the PerformanceScore Field
avg(Page2.Score1, Page2.Score2, Page2.Score3, Page2.Score4, Page2.Score5)
which works fine if everybody has 5 scores but if the employee only has 3 scores it should divide the total score by 3 and not by 5.
I am thinking I can do something like this but got no where
var Perfcount
Perfcount = Count(PerfCount)
{
if Page2.Score1 == 0 then else 1
else if
if Page2.Score2 == 0 then else 1
else if
if Page2.Score3 == 0 then else 1
else if
if Page2.Score4 == 0 then else 1
else if
if Page2.Score5 == 0 then else 1
end if
}
(PerformanceScore \ count)*.60
Are you getting any error messages?
var PerformanceScore = Sum(Page2.Score1, Page2.Score2, Page2.Score3, Page2.Score4, Page2.Score5)
var Perfcount = 0
if(Page2.Score1 ne 0) then
Perfcount = 1 + Perfcount
endif
if(Page2.Score2 ne 0) then
Perfcount++
endif
if(Page2.Score3 ne 0) then
Perfcount++
endif
if(Page2.Score4 ne 0) then
Perfcount++
endif
if(Page2.Score5 ne 0) then
Perfcount++
endifif(Perfcount ne 0) then
(PerformanceScore / Perfcount )* 0.60
else
null
endif
George Kaiser