1

I have a report that is giving me grief about this statement:

Format((Sum(Fields!Mean.Value)) / RowNumber("category_desc"), "F2")

The mean field is a calculated field that is the sum of five fields in my table. Category_desc is the group.

When I run the report, I get #Error in the textbox and this error in the log:

‘Textbox119.Paragraphs[0].TextRuns[0]’ uses a numeric aggregate function on data that is not numeric.  Numeric aggregate functions (Sum, Avg, StDev, Var, StDevP, and VarP) can only aggregate numeric data.

I don't know why this error is occurring or how I can stop it. Any clues?

Michael Robinson
  • 1,106
  • 3
  • 13
  • 40

1 Answers1

4

First, make sure your calculated field is returning a numeric type - explicitly cast the return value within your expression.

You can also try to eliminate any potential non-numerics coming into your SUM, as it sounds like "Mean" might contain text data:

Sum(iif(IsNumeric(Fields!Mean.Value), CDbl(Fields!Mean.Value), 0))
kyzen
  • 1,579
  • 1
  • 9
  • 13