Nov 1, 2011 #1 RichGK IS-IT--Management May 10, 2004 7 GB I need to create an average of the values returned that are not equal to zero. Can anyone help please?
I need to create an average of the values returned that are not equal to zero. Can anyone help please?
Nov 1, 2011 1 #2 hilfy Active member Oct 31, 2003 2,564 US You'll have to use a formula to create the number to divide by and another formula to do your average. The first formula will look something like this (I'll call it {@NonZero}: If IsNull({table.value}) or {table.value} = 0 the 0 else 1 The second will look something like this: if sum({@NonZero}) > 0 then sum({table.value})/sum({@NonZero}) else 0 This does the average for the report as a whole. If you need to do it for a group, you'll format the sums like this: sum(value, group field) -Dell A computer only does what you actually told it to do - not what you thought you told it to do. Upvote 0 Downvote
You'll have to use a formula to create the number to divide by and another formula to do your average. The first formula will look something like this (I'll call it {@NonZero}: If IsNull({table.value}) or {table.value} = 0 the 0 else 1 The second will look something like this: if sum({@NonZero}) > 0 then sum({table.value})/sum({@NonZero}) else 0 This does the average for the report as a whole. If you need to do it for a group, you'll format the sums like this: sum(value, group field) -Dell A computer only does what you actually told it to do - not what you thought you told it to do.