I want to calculate the average of 12 running total fields. Some totals fields are empty.
If I calculate the average when one of the total fields is empty, the result is also empty.
The average is only calculated when the 12 running total fields aren't empty.
Does someone knows what I have to do?Instead of an empty field, could you populate it with a 0? Or when you do your average, maybe you could use some kind of If statement to change Empty fields into zeros (If value is NULL Then value = 0). I don't know what the correct syntax for that would be in Crystal Reports though.|||Thanks for the advice. I found a statement which replaces the empty fields with a zero. It's like this:
average (
[if not isnull({#field1}) then ({#field1}) else 0,
if not isnull({#field2}) then ({#field2}) else 0,
if not isnull({#field3}) then ({#field3}) else 0,
...]
)
No comments:
Post a Comment